[Logo]
Forums Register Login
Can't commit because the transaction is in aborted state
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?
Peter,

Let's continue this discussion in your other thread at http://www.coderanch.com/t/91092/JBoss/commit-because-transaction-aborted-state
Screaming fools! It's nothing more than a tiny ad:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS


This thread has been viewed 9471 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 18, 2018 13:00:19.