aspose file tools*
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
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: 10113
    
165

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]
 
jQuery in Action, 2nd edition
 
subject: Can't commit because the transaction is in aborted state