openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Panuska (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-1961) Batching problem
Date Wed, 16 Mar 2011 11:03:29 GMT
Batching problem
----------------

                 Key: OPENJPA-1961
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1961
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 1.2.1
         Environment: JPA version: JPA 1.2.1
App. server: Websphere 7
Database: Oracle DB
            Reporter: Martin Panuska


Code fragment:

Entities configuration:

public class Parent {
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PARENT_SEQ")
	private long id;
	
	@OneToMany(
		mappedBy = "parent", 
		fetch = FetchType.EAGER,
		cascade = {CascadeType.PERSIST}
	)
	private List<Child> children;
.......

public class Child {
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CHILD_SEQ")
	private long id;
	
	@ManyToOne
	@JoinColumn(name = "parent_id", referencedColumnName = "ID")
	private Parent parent;
....

Bean code:
@Stateless
public class ParentBean implements ParentBeanLocal {
    public ParentBean() {
    }

    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void createParent(Parent parent){
    	EntityManager em =	null;
    	try{
    		em = Finder.getFactory().createEntityManager();
    		em.persist(parent);
    	}finally{
   			closeEm(em);
    	}
    }

When I call this bean from servlet multiple times, following exception occurs:
[3/16/11 11:59:05:687 CET] 00000015 SystemOut     O 0  TutorialEJB  INFO   [WebContainer :
0] openjpa.Runtime - Starting OpenJPA 1.2.1-SNAPSHOT
[3/16/11 11:59:05:859 CET] 00000015 SystemOut     O 172  TutorialEJB  TRACE  [WebContainer
: 0] openjpa.jdbc.SQL - <t 2077064141, conn 1764976947> executing prepstmnt 1796631318

SELECT sogar1.SGBASKET_SEQ.NEXTVAL 
    FROM DUAL 

[3/16/11 11:59:05:875 CET] 00000015 SystemOut     O 188  TutorialEJB  TRACE  [WebContainer
: 0] openjpa.jdbc.SQL - <t 2077064141, conn 1764976947> [16 ms] spent
[3/16/11 11:59:05:875 CET] 00000015 SystemOut     O 188  TutorialEJB  TRACE  [WebContainer
: 0] openjpa.jdbc.SQL - <t 2077064141, conn 270143514> executing prepstmnt 301797885

SELECT sogar1.SGBASKET_SEQ.NEXTVAL 
    FROM DUAL 

[3/16/11 11:59:05:890 CET] 00000015 SystemOut     O 203  TutorialEJB  TRACE  [WebContainer
: 0] openjpa.jdbc.SQL - <t 2077064141, conn 270143514> [15 ms] spent
[3/16/11 11:59:05:890 CET] 00000015 SystemOut     O 203  TutorialEJB  TRACE  [WebContainer
: 0] openjpa.jdbc.SQL - <t 2077064141, conn 702425566> executing prepstmnt 761736551

INSERT INTO sogar1.MP_CHILD (ID, parent_id) 
    VALUES (?, ?) 
[params=(long) 906, (long) 905]
[3/16/11 11:59:05:921 CET] 00000015 SystemOut     O 234  TutorialEJB  TRACE  [WebContainer
: 0] openjpa.jdbc.SQL - <t 2077064141, conn 702425566> [31 ms] spent
[3/16/11 11:59:05:921 CET] 00000015 SystemOut     O 234  TutorialEJB  TRACE  [WebContainer
: 0] openjpa.jdbc.SQL - <t 2077064141, conn 702425566> executing prepstmnt 1679844384

INSERT INTO sogar1.MP_CHILD (ID, parent_id) 
    VALUES (?, ?) 
[params=(long) 906, (long) 905]
[3/16/11 11:59:05:937 CET] 00000015 SystemOut     O 250  TutorialEJB  TRACE  [WebContainer
: 0] openjpa.jdbc.SQL - <t 2077064141, conn 702425566> [16 ms] spent
[3/16/11 11:59:05:937 CET] 00000015 RegisteredSyn E   WTRN0074E: Exception caught from before_completion
synchronization operation: <openjpa-1.2.1-SNAPSHOT-r422266:686069 fatal general error>
org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back.
 See the nested exceptions for details on the errors that occurred.
	at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2163)
	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
	at com.ibm.ws.uow.ComponentContextSynchronizationWrapper.beforeCompletion(ComponentContextSynchronizationWrapper.java:65)
	at com.ibm.tx.jta.RegisteredSyncs.coreDistributeBefore(RegisteredSyncs.java:289)
	at com.ibm.ws.tx.jta.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:150)
	at com.ibm.ws.tx.jta.TransactionImpl.prePrepare(TransactionImpl.java:2222)
	at com.ibm.ws.tx.jta.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:486)
	at com.ibm.tx.jta.TransactionImpl.processCommit(TransactionImpl.java:978)
	at com.ibm.tx.jta.TransactionImpl.commit(TransactionImpl.java:913)
	at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:369)
	at com.ibm.tx.jta.TranManagerSet.commit(TranManagerSet.java:161)
	at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:915)
	at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:228)
	at com.ibm.ejs.csi.RequiresNew.postInvoke(RequiresNew.java:137)
	at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:561)
	at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4512)
	at com.martin.jpa.entity.cascade.EJSLocal0SLParentBean_2b23906b.createParent(EJSLocal0SLParentBean_2b23906b.java)
	at com.martin.servlet.TestServlet.doPost(TestServlet.java:57)
	at com.martin.servlet.TestServlet.doGet(TestServlet.java:35)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
	at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
	at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
Caused by: <openjpa-1.2.1-SNAPSHOT-r422266:686069 nonfatal general error> org.apache.openjpa.persistence.PersistenceException:
ORA-02291: integrity constraint (SOGAR1.SYS_C0032645) violated - parent key not found
 {prepstmnt 761736551 
INSERT INTO sogar1.MP_CHILD (ID, parent_id) 
    VALUES (?, ?) 
[params=(long) 906, (long) 905]} [code=2291, state=23000]
FailedObject: com.martin.jpa.entity.cascade.Child@62e062e0
	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4231)
	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4196)
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:72)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:131)
	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.batchOrExecuteRow(BatchingPreparedStatementManagerImpl.java:102)
	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:86)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:89)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:72)
	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:105)
	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
	at com.ibm.ws.persistence.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:78)
	at com.ibm.ws.persistence.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:60)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:655)
	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
	... 44 more
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-02291: integrity constraint
(SOGAR1.SYS_C0032645) violated - parent key not found
 {prepstmnt 761736551 
INSERT INTO sogar1.MP_CHILD (ID, parent_id) 
    VALUES (?, ?) 
[params=(long) 906, (long) 905]} [code=2291, state=23000]
	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:57)
	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:866)
	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1504)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:151)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:120)
	... 55 more
NestedThrowables:
<openjpa-1.2.1-SNAPSHOT-r422266:686069 nonfatal general error> org.apache.openjpa.persistence.PersistenceException:
ORA-02291: integrity constraint (SOGAR1.SYS_C0032645) violated - parent key not found

FailedObject: prepstmnt 1679844384 
INSERT INTO sogar1.MP_CHILD (ID, parent_id) 
    VALUES (?, ?) 
 [org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement]
	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4231)
	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4196)
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:72)
	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushBatch(BatchingPreparedStatementManagerImpl.java:195)
	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:63)
	at com.ibm.ws.persistence.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:78)
	at com.ibm.ws.persistence.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:60)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:655)
	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
	at com.ibm.ws.uow.ComponentContextSynchronizationWrapper.beforeCompletion(ComponentContextSynchronizationWrapper.java:65)
	at com.ibm.tx.jta.RegisteredSyncs.coreDistributeBefore(RegisteredSyncs.java:289)
	at com.ibm.ws.tx.jta.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:150)
	at com.ibm.ws.tx.jta.TransactionImpl.prePrepare(TransactionImpl.java:2222)
	at com.ibm.ws.tx.jta.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:486)
	at com.ibm.tx.jta.TransactionImpl.processCommit(TransactionImpl.java:978)
	at com.ibm.tx.jta.TransactionImpl.commit(TransactionImpl.java:913)
	at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:369)
	at com.ibm.tx.jta.TranManagerSet.commit(TranManagerSet.java:161)
	at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:915)
	at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:228)
	at com.ibm.ejs.csi.RequiresNew.postInvoke(RequiresNew.java:137)
	at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:561)
	at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4512)
	at com.martin.jpa.entity.cascade.EJSLocal0SLParentBean_2b23906b.createParent(EJSLocal0SLParentBean_2b23906b.java)
	at com.martin.servlet.TestServlet.doPost(TestServlet.java:57)
	at com.martin.servlet.TestServlet.doGet(TestServlet.java:35)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
	at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
	at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
Caused by: java.sql.SQLException: ORA-02291: integrity constraint (SOGAR1.SYS_C0032645) violated
- parent key not found

	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
	at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)
	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
	at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
	at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteUpdate(WSJdbcPreparedStatement.java:1097)
	at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeUpdate(WSJdbcPreparedStatement.java:738)
	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:864)
	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1504)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:151)
	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushSingleRow(BatchingPreparedStatementManagerImpl.java:217)
	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushBatch(BatchingPreparedStatementManagerImpl.java:156)
	... 49 more
---- Begin backtrace for Nested Throwables
java.sql.SQLException: ORA-02291: integrity constraint (SOGAR1.SYS_C0032645) violated - parent
key not found

	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
	at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)
	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
	at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
	at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteUpdate(WSJdbcPreparedStatement.java:1097)
	at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeUpdate(WSJdbcPreparedStatement.java:738)
	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:864)
	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1504)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:151)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:120)
	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.batchOrExecuteRow(BatchingPreparedStatementManagerImpl.java:102)
	at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:86)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:89)
	at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:72)
	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
	at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:105)
	at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
	at com.ibm.ws.persistence.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:78)
	at com.ibm.ws.persistence.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:60)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:655)
	at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
	at com.ibm.ws.uow.ComponentContextSynchronizationWrapper.beforeCompletion(ComponentContextSynchronizationWrapper.java:65)
	at com.ibm.tx.jta.RegisteredSyncs.coreDistributeBefore(RegisteredSyncs.java:289)
	at com.ibm.ws.tx.jta.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:150)
	at com.ibm.ws.tx.jta.TransactionImpl.prePrepare(TransactionImpl.java:2222)
	at com.ibm.ws.tx.jta.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:486)
	at com.ibm.tx.jta.TransactionImpl.processCommit(TransactionImpl.java:978)
	at com.ibm.tx.jta.TransactionImpl.commit(TransactionImpl.java:913)
	at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:369)
	at com.ibm.tx.jta.TranManagerSet.commit(TranManagerSet.java:161)
	at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:915)
	at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:228)
	at com.ibm.ejs.csi.RequiresNew.postInvoke(RequiresNew.java:137)
	at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:561)
	at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4512)
	at com.martin.jpa.entity.cascade.EJSLocal0SLParentBean_2b23906b.createParent(EJSLocal0SLParentBean_2b23906b.java)
	at com.martin.servlet.TestServlet.doPost(TestServlet.java:57)
	at com.martin.servlet.TestServlet.doGet(TestServlet.java:35)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
	at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
	at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

[3/16/11 11:59:05:968 CET] 00000015 servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper
service SRVE0068E: Uncaught exception created in one of the service methods of the servlet
TestServlet in application TutorialEJBEAR. Exception created : javax.ejb.EJBTransactionRolledbackException:

	at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:942)
	at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:228)
	at com.ibm.ejs.csi.RequiresNew.postInvoke(RequiresNew.java:137)
	at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:561)
	at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4512)
	at com.martin.jpa.entity.cascade.EJSLocal0SLParentBean_2b23906b.createParent(EJSLocal0SLParentBean_2b23906b.java)
	at com.martin.servlet.TestServlet.doPost(TestServlet.java:57)
	at com.martin.servlet.TestServlet.doGet(TestServlet.java:35)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
	at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
	at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

[3/16/11 11:59:05:968 CET] 00000015 LocalTranCoor E   WLTC0017E: Resources rolled back due
to setRollbackOnly() being called.
[3/16/11 11:59:05:984 CET] 00000015 webapp        E com.ibm.ws.webcontainer.webapp.WebApp
logServletError SRVE0293E: [Servlet Error]-[TestServlet]: javax.ejb.EJBTransactionRolledbackException:

	at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:942)
	at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:228)
	at com.ibm.ejs.csi.RequiresNew.postInvoke(RequiresNew.java:137)
	at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:561)
	at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4512)
	at com.martin.jpa.entity.cascade.EJSLocal0SLParentBean_2b23906b.createParent(EJSLocal0SLParentBean_2b23906b.java)
	at com.martin.servlet.TestServlet.doPost(TestServlet.java:57)
	at com.martin.servlet.TestServlet.doGet(TestServlet.java:35)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
	at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
	at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)


Problem disappears when batching is disabled:
<property name="openjpa.jdbc.UpdateManager" value="com.ibm.ws.persistence.jdbc.kernel.OperationOrderUpdateManager(batchLimit=0)"/>

I'm not 100% sure if this is problem in Open JPA or Webspehere extension of JPA.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message