IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • No replies
SystemAdmin
SystemAdmin
2768 Posts

Pinned topic Commit exception in EJB 3

‏2009-11-20T03:31:46Z |
Hi

I am getting the below JPA exception when trying to save an entity using EJB3 in websphere,

WTRN0074E: Exception caught from before_completion synchronization operation: <openjpa-1.0.1-r420667:592145 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null
at org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.getConnection(AbstractJDBCSeq.java:162)
at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:366)
at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:266)
at org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
at org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
at org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:557)
at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:450)
at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:426)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:541)
at org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
at org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:501)
at org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2770)
at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:940)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1892)
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
at com.ibm.ws.uow.ComponentContextSynchronizationWrapper.beforeCompletion(ComponentContextSynchronizationWrapper.java:66)
at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:242)
at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java:2399)
at com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1632)
at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1603)
at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1538)
at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:239)
at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:163)
at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:782)
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:206)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:581)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4210)
at com.ram.ejb3.session.EJSLocal0SLMovieTaskImpl_6e21ca15.saveNewMovie(EJSLocal0SLMovieTaskImpl_6e21ca15.java)
:
:
:
:
Caused by: javax.transaction.SystemException
at org.apache.openjpa.ee.RegistryManagedRuntime$TransactionManagerRegistryFacade.suspend(RegistryManagedRuntime.java:176)
at org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.getConnection(AbstractJDBCSeq.java:158)
... 55 more

@Entity @Table (name=
"MOVIE") 

public 

class Movie 
{ 

public Long movieId; 

public String movieName; 

public String genre; 

public String year; 

public Trailer trailer; 

public Director director; 

public Actor actor; 

public String getGenre() 
{ 

return genre; 
} 
/** * @param genre The genre to set. */ 

public 

void setGenre(String genre) 
{ this.genre = genre; 
} @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name=
"MOVIE_ID") 

public Long getMovieId() 
{


And my persistance.xml is


<?xml version=
"1.0" encoding=
"UTF-8"?> <persistence xmlns=
"http://java.sun.com/xml/ns/persistence" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" version=
"1.0" xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name=
"CUST_DB"> <jta-data-source>jdbc/Lending</jta-data-source> <properties> <property name=
"openjpa.TransactionMode" value=
"managed"/> <property name=
"openjpa.ConnectionFactoryMode" value=
"managed"/>   </properties> </persistence-unit> </persistence>


I am using RAD 7.0 and Websphere 6.1, also installed EJB 3 feature pack,can anyone help me to resolve this issue.