This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Can't commit because the transaction is in aborted state Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Can Watch "Can New topic
Author

Can't commit because the transaction is in aborted state

peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
the whole error message is
javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state

I am using EJB3 Container-Managerd Entity Managers.
NetBean 5.5.1 JBOSS 4.2.2GA

the following is some segment of my stateless session bean

@PersistenceContext
private EntityManager em;

@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void createItem (String itcode, String ituom, double itcost, double itsrp, double itwhbal, String expired){
Item item = new Item(itcode, ituom, itcost, itsrp, itwhbal, expired) ;
em.persist(item);
}

I intentionally add a duplicate key in itcode (the primary key field), but the error message is
javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state

why the transaction is in aborted state?
how to fix it?
also, is it related to JBOSS server problem?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10379
    
174

Peter,

Let's continue this discussion in your other thread at http://www.coderanch.com/t/91092/JBoss/commit-because-transaction-aborted-state


[My Blog] [JavaRanch Journal]
 
Don't get me started about those stupid light bulbs.
 
subject: Can't commit because the transaction is in aborted state