Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 71472 invoked from network); 19 Nov 2009 13:40:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Nov 2009 13:40:01 -0000 Received: (qmail 69612 invoked by uid 500); 19 Nov 2009 13:40:01 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 69527 invoked by uid 500); 19 Nov 2009 13:40:00 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 69517 invoked by uid 99); 19 Nov 2009 13:40:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Nov 2009 13:40:00 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ajiyos@gmail.com designates 209.85.223.201 as permitted sender) Received: from [209.85.223.201] (HELO mail-iw0-f201.google.com) (209.85.223.201) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Nov 2009 13:39:57 +0000 Received: by iwn39 with SMTP id 39so1606418iwn.25 for ; Thu, 19 Nov 2009 05:39:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Y3ssr/fYnH4RGmcfWpz/L3KKY4VyYN2Ni+v9HzU4WPg=; b=RqVA+KQsMTqxiIJk4gwB/m8ss03TDNhXHoZM0zjJdEuyx4ONpP1oaEBloOIB4dRrWs S3JvPdswpuffsha/LgbzMe+GyCnYunwp1jRCAzTsJej0od3muxJvRWl9tFmiHVU0xFoC Q9Dyhu5qkDSowci5SFS1x6myxQ47NkYopUNDY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=vlWZWMjp0WMHGJt2/A32opvQDYfRfqE2NVyPmykHJun9vNwkiMMBOKgE3Zn6565ua5 sBSRvy7BwadDILaC8etKwc2f1bhWjIW50z/VgIIlV/t+3k842UMU5UN1z2ViwX1N7QCz dPcWtnMq1ETrkmpwpCLp0PHSzoZYZfmCVMs1s= MIME-Version: 1.0 Received: by 10.231.122.36 with SMTP id j36mr1393556ibr.21.1258637976151; Thu, 19 Nov 2009 05:39:36 -0800 (PST) Date: Thu, 19 Nov 2009 19:09:36 +0530 Message-ID: Subject: Intermittent OptimisticException with Persist on many to many self referencing entities. From: Ajiyos Yohannan To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=0016e64603ea782b210478b97dfe --0016e64603ea782b210478b97dfe Content-Type: text/plain; charset=ISO-8859-1 I have a self referencing table "PR_PARTNER" with ManyToMany relationship using a join table PR_CATLINK * public class _Partner implements Serializable { ..... @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="partnerSeqGen") private int partnerId; @Version private int rowts; @ManyToMany @JoinTable(name = "PR_PRCAT_LNK", joinColumns = @JoinColumn(name = "PARTNERID"), inverseJoinColumns = @JoinColumn(name = "CATEGORYID", referencedColumnName = "PARTNERID")) private Set<_Partner> categories = new HashSet<_Partner>(); @ManyToMany(mappedBy = "categories") private Set<_Partner> members = new HashSet<_Partner>(); }* I am using openjpa as standalone mode(not container managed) from servlet container. I am invoking a servlet which persist the category with multiple members. On third/fourth invocation I am getting OptimisticException. I am not sharing the entitymanager I havent enabled the data cache *Observation* is that for the failing invocation, the version field is not updated for the children entities in the cache though the version is changed in the db. Logs: I [11/18/09 11:51:16:671 GMT+05:30] 00000049 SystemErr R 62304453 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - executing prepstmnt 820523240 INSERT INTO PR_PARTNER (partnerId, categoryFlag, createdate, description, DISPLAYNAME, NAME, statusFlg, updatedate, website, rowts, COMMUNITYID, PARENTPARTNERID, PARTNERTYPEID, VENDORTYPENAME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(int) 35, (int) 1, (Timestamp) 2009-11-18 11:51:16.218, (String) szjdfsd, (null) null, (String) today, (int) 0, (Timestamp) 2009-11-18 11:51:16.218, (null) null, (int) 1, (int) 1, (null) null, (int) 2, (null) null] [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [16 ms] spent [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1573674444 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 13, (int) 6, (int) 12] [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1573674444 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 9, (int) 8, (int) 8] [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1573674444 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 16, (int) 3, (int) 15] [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - executing batch prepstmnt 1573674444 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 16, (int) 3, (int) 15] [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1636655501 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 6, (int) 35] [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:51:16:687 GMT+05:30] 00000049 SystemErr R 62304469 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1636655501 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 8, (int) 35] [11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr R 62304485 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr R 62304485 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1636655501 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 3, (int) 35] [11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr R 62304485 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr R 62304485 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - executing batch prepstmnt 1636655501 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 3, (int) 35] [11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr R 62304485 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr R 62304485 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.JDBC - [0 ms] commit [11/18/09 11:51:16:703 GMT+05:30] 00000049 SystemErr R 62304485 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.JDBC - [0 ms] close 03578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - executing prepstmnt 569385456 INSERT INTO PR_PARTNER (partnerId, categoryFlag, createdate, description, DISPLAYNAME, NAME, statusFlg, updatedate, website, rowts, COMMUNITYID, PARENTPARTNERID, PARTNERTYPEID, VENDORTYPENAME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(int) 36, (int) 1, (Timestamp) 2009-11-18 11:57:55.406, (String) SDF, (null) null, (String) TodAY1, (int) 0, (Timestamp) 2009-11-18 11:57:55.406, (null) null, (int) 1, (int) 1, (null) null, (int) 2, (null) null] [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - batching prepstmnt 1833266501 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 2, (int) 4, (int) 1] [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - batching prepstmnt 1833266501 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 14, (int) 6, (int) 13] [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - batching prepstmnt 1833266501 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 10, (int) 8, (int) 9] [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - executing batch prepstmnt 1833266501 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 10, (int) 8, (int) 9] [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - batching prepstmnt 1238911448 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 4, (int) 36] [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - batching prepstmnt 1238911448 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 6, (int) 36] [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - batching prepstmnt 1238911448 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 8, (int) 36] [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 11:57:55:796 GMT+05:30] 00000045 SystemErr R 62703578 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - executing batch prepstmnt 1238911448 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 8, (int) 36] [11/18/09 11:57:55:812 GMT+05:30] 00000045 SystemErr R 62703594 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.SQL - [16 ms] spent [11/18/09 11:57:55:812 GMT+05:30] 00000045 SystemErr R 62703594 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.JDBC - [0 ms] commit [11/18/09 11:57:55:812 GMT+05:30] 00000045 SystemErr R 62703594 DataAccessLayer TRACE [WebContainer : 1] openjpa.jdbc.JDBC - [0 ms] close ...... [11/18/09 12:06:07:578 GMT+05:30] 00000049 SystemErr R 63195360 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - executing prepstmnt 226364798 INSERT INTO PR_PARTNER (partnerId, categoryFlag, createdate, description, DISPLAYNAME, NAME, statusFlg, updatedate, website, rowts, COMMUNITYID, PARENTPARTNERID, PARTNERTYPEID, VENDORTYPENAME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(int) 37, (int) 1, (Timestamp) 2009-11-18 12:06:07.187, (String) skfdsdf, (null) null, (String) today3, (int) 0, (Timestamp) 2009-11-18 12:06:07.187, (null) null, (int) 1, (int) 1, (null) null, (int) 2, (null) null] [11/18/09 12:06:07:578 GMT+05:30] 00000049 SystemErr R 63195360 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 12:06:07:578 GMT+05:30] 00000049 SystemErr R 63195360 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1446794812 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 14, (int) 6, (int) 13] [11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr R 63195375 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [15 ms] spent [11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr R 63195375 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1446794812 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 10, (int) 8, (int) 9] [11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr R 63195375 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr R 63195375 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1446794812 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 17, (int) 3, (int) 16] [11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr R 63195375 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 12:06:07:593 GMT+05:30] 00000049 SystemErr R 63195375 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - executing batch prepstmnt 1446794812 UPDATE PR_PARTNER SET rowts = ? WHERE partnerId = ? AND rowts = ? [params=(int) 17, (int) 3, (int) 16] [11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr R 63195407 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [32 ms] spent [11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr R 63195407 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1434604930 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 6, (int) 37] [11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr R 63195407 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr R 63195407 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1434604930 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 8, (int) 37] [11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr R 63195407 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr R 63195407 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - batching prepstmnt 1434604930 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 3, (int) 37] [11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr R 63195407 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr R 63195407 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - executing batch prepstmnt 1434604930 INSERT INTO PR_PRCAT_LNK (PARTNERID, CATEGORYID) VALUES (?, ?) [params=(int) 3, (int) 37] [11/18/09 12:06:07:625 GMT+05:30] 00000049 SystemErr R 63195407 DataAccessLayer TRACE [WebContainer : 7] openjpa.jdbc.SQL - [0 ms] spent [11/18/09 12:06:07:640 GMT+05:30] 00000049 SystemErr R 63195407 DataAccessLayer TRACE [WebContainer : 7] openjpa.Runtime - An exception occurred while ending the transaction. This exception will be re-thrown. org.apache.openjpa.util.OptimisticException: Optimistic locking errors were detected when flushing to the data store. The following objects may have been concurrently modified in another transaction: [com.ibm.bcgex.core.dal.model._Partner-6, com.ibm.bcgex.core.dal.model._Partner-8] at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2160) 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 org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81) at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1350) at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877) at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512) Please help. Thanks, Ajiyos --0016e64603ea782b210478b97dfe--