[jira] Created: (OPENJPA-1914) Issue with OpenJPA 1.2.1 while using subquery.
Issue with OpenJPA 1.2.1 while using subquery. -- Key: OPENJPA-1914 URL: https://issues.apache.org/jira/browse/OPENJPA-1914 Project: OpenJPA Issue Type: Bug Affects Versions: 1.2.1 Environment: Database server= DB2 z/OS 9.1.5 in AIX system. Working from standalone java program. using log4j-1.2.14.jar and geronimo-jpa_3.0_spec-1.0.jar Reporter: JaiKumar On using below code to update an JournalNumber entity .. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1914) Issue with OpenJPA 1.2.1 while using subquery.
[ https://issues.apache.org/jira/browse/OPENJPA-1914?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] JaiKumar updated OPENJPA-1914: -- Description: On using below code to update an JournalNumber entity .. tx = entityManager.getTransaction(); tx.begin(); System.out.println("...Clone :" + cloneId); String query = "UPDATE JournalNumber jrNbr SET jrNbr.updated_on=:updatedOn WHERE (jrNbr.countryCode,jrNbr.sourceCode) NOT IN(SELECT vNbr.countryCode,vNbr.sourceCode FROM VoucherNumber vNbr,Country ctyEntity WHERE vNbr.countryCode = ctyEntity.cty AND ctyEntity.cln_identity=:clnIdentity)"; Query q = entityManager.createQuery(query); q.setParameter("updatedOn", new Date()); q.setParameter("clnIdentity", cloneId); q.executeUpdate(); tx.commit(); I get below error .. org.apache.openjpa.persistence.ArgumentException: Encountered "jrNbr . countryCode ," at character 67, but expected: ["(", ")", "*", "+", "-", ".", "/", ":", "<", "<=", "<>", "=", ">", ">=", "?", "ABS", "ALL", "AND", "ANY", "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", , , , ]. was:On using below code to update an JournalNumber entity .. Early one got submitted accidently with partial info. > Issue with OpenJPA 1.2.1 while using subquery. > -- > > Key: OPENJPA-1914 > URL: https://issues.apache.org/jira/browse/OPENJPA-1914 > Project: OpenJPA > Issue Type: Bug >Affects Versions: 1.2.1 > Environment: Database server= DB2 z/OS 9.1.5 in AIX system. > Working from standalone java program. using log4j-1.2.14.jar and > geronimo-jpa_3.0_spec-1.0.jar >Reporter: JaiKumar > > On using below code to update an JournalNumber entity .. > tx = entityManager.getTransaction(); > tx.begin(); > System.out.println("...Clone :" + cloneId); > String query = "UPDATE JournalNumber jrNbr SET > jrNbr.updated_on=:updatedOn WHERE (jrNbr.countryCode,jrNbr.sourceCode) NOT > IN(SELECT vNbr.countryCode,vNbr.sourceCode FROM VoucherNumber vNbr,Country > ctyEntity WHERE vNbr.countryCode = ctyEntity.cty AND > ctyEntity.cln_identity=:clnIdentity)"; > Query q = entityManager.createQuery(query); > q.setParameter("updatedOn", new Date()); > q.setParameter("clnIdentity", cloneId); > q.executeUpdate(); > tx.commit(); > I get below error .. > > org.apache.openjpa.persistence.ArgumentException: Encountered "jrNbr . > countryCode ," at character 67, but expected: ["(", ")", "*", "+", "-", ".", > "/", ":", "<", "<=", "<>", "=", ">", ">=", "?", "ABS", "ALL", "AND", "ANY", > "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", > "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", > "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", > "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", > "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", > "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", > "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", , > , , ]. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (OPENJPA-1915) missing license header
missing license header -- Key: OPENJPA-1915 URL: https://issues.apache.org/jira/browse/OPENJPA-1915 Project: OpenJPA Issue Type: Bug Affects Versions: 2.2.0 Reporter: Mark Struberg Fix For: 2.2.0 a few files miss the ALv2 license headers thus leading to a build error -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Assigned: (OPENJPA-1915) missing license header
[ https://issues.apache.org/jira/browse/OPENJPA-1915?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Curtis reassigned OPENJPA-1915: Assignee: Rick Curtis > missing license header > -- > > Key: OPENJPA-1915 > URL: https://issues.apache.org/jira/browse/OPENJPA-1915 > Project: OpenJPA > Issue Type: Bug >Affects Versions: 2.2.0 >Reporter: Mark Struberg >Assignee: Rick Curtis > Fix For: 2.2.0 > > > a few files miss the ALv2 license headers thus leading to a build error -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1915) missing license header
[ https://issues.apache.org/jira/browse/OPENJPA-1915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977305#action_12977305 ] Rick Curtis commented on OPENJPA-1915: -- It looks like Fay missed a couple headers with her latest commit... sorry I missed the build break. I'll get it cleaned up asap. > missing license header > -- > > Key: OPENJPA-1915 > URL: https://issues.apache.org/jira/browse/OPENJPA-1915 > Project: OpenJPA > Issue Type: Bug >Affects Versions: 2.2.0 >Reporter: Mark Struberg >Assignee: Rick Curtis > Fix For: 2.2.0 > > > a few files miss the ALv2 license headers thus leading to a build error -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1915) missing license header
[ https://issues.apache.org/jira/browse/OPENJPA-1915?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mark Struberg updated OPENJPA-1915: --- Attachment: OPENJPA-1915.patch patch for adding the license headers > missing license header > -- > > Key: OPENJPA-1915 > URL: https://issues.apache.org/jira/browse/OPENJPA-1915 > Project: OpenJPA > Issue Type: Bug >Affects Versions: 2.2.0 >Reporter: Mark Struberg >Assignee: Rick Curtis > Fix For: 2.2.0 > > Attachments: OPENJPA-1915.patch > > > a few files miss the ALv2 license headers thus leading to a build error -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Closed: (OPENJPA-1915) missing license header
[ https://issues.apache.org/jira/browse/OPENJPA-1915?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Curtis closed OPENJPA-1915. Resolution: Fixed > missing license header > -- > > Key: OPENJPA-1915 > URL: https://issues.apache.org/jira/browse/OPENJPA-1915 > Project: OpenJPA > Issue Type: Bug >Affects Versions: 2.2.0 >Reporter: Mark Struberg >Assignee: Rick Curtis > Fix For: 2.2.0 > > Attachments: OPENJPA-1915.patch > > > a few files miss the ALv2 license headers thus leading to a build error -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (OPENJPA-1916) error in daytrader example
error in daytrader example -- Key: OPENJPA-1916 URL: https://issues.apache.org/jira/browse/OPENJPA-1916 Project: OpenJPA Issue Type: Bug Reporter: Mark Struberg Caused by: org.apache.openjpa.persistence.EntityExistsException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'SQL101231130328100' defined on 'QUOTEEJB'. {prepstmnt 2067056127 INSERT INTO quoteejb (SYMBOL, CHANGE1, COMPANYNAME, HIGH, LOW, OPEN1, PRICE, VOLUME) VALUES (?, ?, ?, ?, ?, ?, ?, ?) [params=?, ?, ?, ?, ?, ?, ?, ?]} [code=2, state=23505] FailedObject: org.apache.openjpa.integration.daytrader.quotedatab...@39757337 at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4854) at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4829) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78) at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143) so it's not possible to perform a build -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1913) If fetch-groups is used, detaching an entity will lead to all lazy loaded members get reset to null
[ https://issues.apache.org/jira/browse/OPENJPA-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mark Struberg updated OPENJPA-1913: --- Attachment: OPENJPA-1913-enhancer-fix.patch this small patch fixes a few errors I had in the enhancer section. > If fetch-groups is used, detaching an entity will lead to all lazy loaded > members get reset to null > --- > > Key: OPENJPA-1913 > URL: https://issues.apache.org/jira/browse/OPENJPA-1913 > Project: OpenJPA > Issue Type: Bug > Components: kernel >Affects Versions: 2.1.0 >Reporter: Mark Struberg > Fix For: 2.2.0 > > Attachments: OPENJPA-1913-enhancer-fix.patch, OPENJPA-1913-test.patch > > > If I use openjpa.DetachState=fetch-groups and detach an entity with a lazy > loaded list, this list gets reset to null. > An example: > class @Entity Person { >private String name; > @OneToMany(mappedBy = "group", cascade = {CascadeType.ALL}) > private List subscriptions = new ArrayList(); > ...} > I load the Person and access the subscriptions inside a transaction. I get a > person instance with e.g. 3 subscriptions. > If I now close the EntityManager and my person gets detached, the > subscriptions list is suddenly null! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Assigned: (OPENJPA-1916) error in daytrader example
[ https://issues.apache.org/jira/browse/OPENJPA-1916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Curtis reassigned OPENJPA-1916: Assignee: Rick Curtis > error in daytrader example > -- > > Key: OPENJPA-1916 > URL: https://issues.apache.org/jira/browse/OPENJPA-1916 > Project: OpenJPA > Issue Type: Bug >Reporter: Mark Struberg >Assignee: Rick Curtis > > Caused by: > org.apache.openjpa.persistence.EntityExistsException: The statement was > aborted because it would have caused a duplicate key value in a unique or > primary key constraint or unique index identified by 'SQL101231130328100' > defined on 'QUOTEEJB'. {prepstmnt 2067056127 INSERT INTO quoteejb (SYMBOL, > CHANGE1, COMPANYNAME, HIGH, LOW, OPEN1, PRICE, VOLUME) VALUES (?, ?, ?, ?, ?, > ?, ?, ?) [params=?, ?, ?, ?, ?, ?, ?, ?]} [code=2, state=23505] > FailedObject: org.apache.openjpa.integration.daytrader.quotedatab...@39757337 > at > org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4854) > at > org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4829) > at > org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136) > at > org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78) > at > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143) > so it's not possible to perform a build -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1916) error in daytrader example
[ https://issues.apache.org/jira/browse/OPENJPA-1916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977374#action_12977374 ] Rick Curtis commented on OPENJPA-1916: -- Mark this seems to be working fine for me? It sounds like something isn't getting cleaned up from one of the previous runs. Can you try running 'clean' on openjpa-example and retest? > error in daytrader example > -- > > Key: OPENJPA-1916 > URL: https://issues.apache.org/jira/browse/OPENJPA-1916 > Project: OpenJPA > Issue Type: Bug >Reporter: Mark Struberg >Assignee: Rick Curtis > > Caused by: > org.apache.openjpa.persistence.EntityExistsException: The statement was > aborted because it would have caused a duplicate key value in a unique or > primary key constraint or unique index identified by 'SQL101231130328100' > defined on 'QUOTEEJB'. {prepstmnt 2067056127 INSERT INTO quoteejb (SYMBOL, > CHANGE1, COMPANYNAME, HIGH, LOW, OPEN1, PRICE, VOLUME) VALUES (?, ?, ?, ?, ?, > ?, ?, ?) [params=?, ?, ?, ?, ?, ?, ?, ?]} [code=2, state=23505] > FailedObject: org.apache.openjpa.integration.daytrader.quotedatab...@39757337 > at > org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4854) > at > org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4829) > at > org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136) > at > org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78) > at > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143) > so it's not possible to perform a build -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1911) InvalidStateException is thrown when merge an entity with derived identiy
[ https://issues.apache.org/jira/browse/OPENJPA-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Curtis updated OPENJPA-1911: - Affects Version/s: 2.1.0 2.0.2 Fix Version/s: 2.1.0 > InvalidStateException is thrown when merge an entity with derived identiy > - > > Key: OPENJPA-1911 > URL: https://issues.apache.org/jira/browse/OPENJPA-1911 > Project: OpenJPA > Issue Type: Bug > Components: kernel >Affects Versions: 2.0.2, 2.1.0, 2.2.0 >Reporter: Fay Wang >Assignee: Fay Wang > Fix For: 2.1.0, 2.2.0 > > > > org.apache.openjpa.persistence.InvalidStateException: Attempt to change a > primary key field of an instance that already has a final object id. Only > new, unflushed instances whose id you have not retrieved can have their > primary keys changed. > FailedObject: > org.apache.openjpa.persistence.xs.AccountingHierarchyRate-TESTING::1 > at > org.apache.openjpa.kernel.StateManagerImpl.assertNoPrimaryKeyChange(StateManagerImpl.java:2086) > at > org.apache.openjpa.kernel.StateManagerImpl.settingObjectField(StateManagerImpl.java:2020) > at > org.apache.openjpa.kernel.AttachStrategy.attachField(AttachStrategy.java:205) > at > org.apache.openjpa.kernel.VersionAttachStrategy.attach(VersionAttachStrategy.java:161) > at > org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:251) > at > org.apache.openjpa.kernel.AttachStrategy.attachCollection(AttachStrategy.java:339) > at > org.apache.openjpa.kernel.AttachStrategy.replaceList(AttachStrategy.java:399) > at > org.apache.openjpa.kernel.AttachStrategy.attachField(AttachStrategy.java:224) > at > org.apache.openjpa.kernel.VersionAttachStrategy.attach(VersionAttachStrategy.java:161) > at > org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:251) > at > org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:104) > at org.apache.openjpa.kernel.BrokerImpl.attach(BrokerImpl.java:3400) > at > org.apache.openjpa.kernel.DelegatingBroker.attach(DelegatingBroker.java:1206) > at > org.apache.openjpa.persistence.EntityManagerImpl.merge(EntityManagerImpl.java:871) > at > org.apache.openjpa.persistence.xs.TestMergeComplexKey.test(TestMergeComplexKey.java:29) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1914) Issue with OpenJPA 1.2.1 while using subquery.
[ https://issues.apache.org/jira/browse/OPENJPA-1914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977392#action_12977392 ] Fay Wang commented on OPENJPA-1914: --- According to the spec, the BNF of the in_expression, subquery are: in_expression ::= state_field_path_expression [NOT] IN ( in_item {, in_item}* | subquery) subquery ::= simple_select_clause subquery_from_clause [where_clause][groupby_clause] [having_clause] simple_select_clause ::= SELECT [DISTINCT] simple_select_expression As can be seen from the BNF, the LHS of the in_expression can be one and only one path expression and the subquery can select one and only one expression or variable. The where clause in your JPQL, therefore, is incorrect: WHERE (jrNbr.countryCode,jrNbr.sourceCode) NOT IN (SELECT vNbr.countryCode,vNbr.sourceCode FROM VoucherNumber vNbr,Country ctyEntity WHERE vNbr.countryCode = ctyEntity.cty AND ctyEntity.cln_identity=:clnIdentity)"; > Issue with OpenJPA 1.2.1 while using subquery. > -- > > Key: OPENJPA-1914 > URL: https://issues.apache.org/jira/browse/OPENJPA-1914 > Project: OpenJPA > Issue Type: Bug >Affects Versions: 1.2.1 > Environment: Database server= DB2 z/OS 9.1.5 in AIX system. > Working from standalone java program. using log4j-1.2.14.jar and > geronimo-jpa_3.0_spec-1.0.jar >Reporter: JaiKumar > > On using below code to update an JournalNumber entity .. > tx = entityManager.getTransaction(); > tx.begin(); > System.out.println("...Clone :" + cloneId); > String query = "UPDATE JournalNumber jrNbr SET > jrNbr.updated_on=:updatedOn WHERE (jrNbr.countryCode,jrNbr.sourceCode) NOT > IN(SELECT vNbr.countryCode,vNbr.sourceCode FROM VoucherNumber vNbr,Country > ctyEntity WHERE vNbr.countryCode = ctyEntity.cty AND > ctyEntity.cln_identity=:clnIdentity)"; > Query q = entityManager.createQuery(query); > q.setParameter("updatedOn", new Date()); > q.setParameter("clnIdentity", cloneId); > q.executeUpdate(); > tx.commit(); > I get below error .. > > org.apache.openjpa.persistence.ArgumentException: Encountered "jrNbr . > countryCode ," at character 67, but expected: ["(", ")", "*", "+", "-", ".", > "/", ":", "<", "<=", "<>", "=", ">", ">=", "?", "ABS", "ALL", "AND", "ANY", > "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", > "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", > "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", > "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", > "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", > "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", > "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", , > , , ]. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1916) error in daytrader example
[ https://issues.apache.org/jira/browse/OPENJPA-1916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977433#action_12977433 ] Mark Struberg commented on OPENJPA-1916: Yes, I tried to resume the build from an OutOfMemoryException ("cannot create new native thread") which I regularly get from TestQueryMultiThreaded#testHeavyLoad(). I now did run a clean build and all worked well. So this whole test suite is not restartable? > error in daytrader example > -- > > Key: OPENJPA-1916 > URL: https://issues.apache.org/jira/browse/OPENJPA-1916 > Project: OpenJPA > Issue Type: Bug >Reporter: Mark Struberg >Assignee: Rick Curtis > > Caused by: > org.apache.openjpa.persistence.EntityExistsException: The statement was > aborted because it would have caused a duplicate key value in a unique or > primary key constraint or unique index identified by 'SQL101231130328100' > defined on 'QUOTEEJB'. {prepstmnt 2067056127 INSERT INTO quoteejb (SYMBOL, > CHANGE1, COMPANYNAME, HIGH, LOW, OPEN1, PRICE, VOLUME) VALUES (?, ?, ?, ?, ?, > ?, ?, ?) [params=?, ?, ?, ?, ?, ?, ?, ?]} [code=2, state=23505] > FailedObject: org.apache.openjpa.integration.daytrader.quotedatab...@39757337 > at > org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4854) > at > org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4829) > at > org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136) > at > org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78) > at > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143) > so it's not possible to perform a build -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1916) error in daytrader example
[ https://issues.apache.org/jira/browse/OPENJPA-1916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mark Struberg updated OPENJPA-1916: --- Priority: Minor (was: Major) set to 'minor'. I didn't close it because tests should generally be repeatable by performing a proper cleanup either before or after they run. > error in daytrader example > -- > > Key: OPENJPA-1916 > URL: https://issues.apache.org/jira/browse/OPENJPA-1916 > Project: OpenJPA > Issue Type: Bug >Reporter: Mark Struberg >Assignee: Rick Curtis >Priority: Minor > > Caused by: > org.apache.openjpa.persistence.EntityExistsException: The statement was > aborted because it would have caused a duplicate key value in a unique or > primary key constraint or unique index identified by 'SQL101231130328100' > defined on 'QUOTEEJB'. {prepstmnt 2067056127 INSERT INTO quoteejb (SYMBOL, > CHANGE1, COMPANYNAME, HIGH, LOW, OPEN1, PRICE, VOLUME) VALUES (?, ?, ?, ?, ?, > ?, ?, ?) [params=?, ?, ?, ?, ?, ?, ?, ?]} [code=2, state=23505] > FailedObject: org.apache.openjpa.integration.daytrader.quotedatab...@39757337 > at > org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4854) > at > org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4829) > at > org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136) > at > org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78) > at > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143) > so it's not possible to perform a build -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Assigned: (OPENJPA-1913) If fetch-groups is used, detaching an entity will lead to all lazy loaded members get reset to null
[ https://issues.apache.org/jira/browse/OPENJPA-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jeremy Bauer reassigned OPENJPA-1913: - Assignee: Jeremy Bauer > If fetch-groups is used, detaching an entity will lead to all lazy loaded > members get reset to null > --- > > Key: OPENJPA-1913 > URL: https://issues.apache.org/jira/browse/OPENJPA-1913 > Project: OpenJPA > Issue Type: Bug > Components: kernel >Affects Versions: 2.1.0 >Reporter: Mark Struberg >Assignee: Jeremy Bauer > Fix For: 2.2.0 > > Attachments: OPENJPA-1913-enhancer-fix.patch, OPENJPA-1913-test.patch > > > If I use openjpa.DetachState=fetch-groups and detach an entity with a lazy > loaded list, this list gets reset to null. > An example: > class @Entity Person { >private String name; > @OneToMany(mappedBy = "group", cascade = {CascadeType.ALL}) > private List subscriptions = new ArrayList(); > ...} > I load the Person and access the subscriptions inside a transaction. I get a > person instance with e.g. 3 subscriptions. > If I now close the EntityManager and my person gets detached, the > subscriptions list is suddenly null! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1914) Issue with OpenJPA 1.2.1 while using subquery.
[ https://issues.apache.org/jira/browse/OPENJPA-1914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977604#action_12977604 ] JaiKumar commented on OPENJPA-1914: --- Thanks for the response, I understand from your statement that only one column can be used in Left hand side of NOT IN operator. And two columns cannot be supported as in original query. i.e, WHERE (jrNbr.countryCode) NOT IN (SELECT vNbr.countryCode FROM VoucherNumber vNbr,Country ctyEntity WHERE vNbr.countryCode = ctyEntity.cty AND ctyEntity.cln_identity=:clnIdentity)"; However the whole idea of using two columns on LHS of NOT IN operator came to me since its supported in DB2 Database with Native sql, for which OpenJPA ver 1.2.1 was failing .. Even its supported by most of other DB like oracle, sqlserver etc. and as well. Using a single table column will not provide similar results when you want to check two column data against single record. Native SQL which will work in client tools for most of database are provided below. UPDATE VITSCM.VITTBGE jnbr SET jnbr.updated_on=:updatedOn WHERE (jnbr.cty,jnbr.src) NOT IN(SELECT a.cty,a.src FROM VITSCF.CFLTBGE a,VITSCM.VITTCTY b WHERE a.cty = b.cty AND b.cln_identity=:clnIdentity) Please provide an alternative for this. Regards, Jai (JaiKumar Kochi Rammohan) Global Ledger User Interface (GLUI) Team, IGA US Finance, IBM India Pvt Ltd, DC7-3-049, Blk 7, DLF IT Park, 3rd Flr, 1/124, Sivaji Gardens, Moonlight Stop, Nandambakkam Post, Ramapuram, Chennai - 600 089, Tamilnadu, India. Work : +91-44-22723586 Board : +91-44-2272 X 3586 TieLine/VOIP: +92 67568, Mobile: +91-9840820310 email:jaikumar...@in.ibm.com "Fay Wang (JIRA)" 04/01/2011 23:56 To Jaikumar K Rammohan/India/i...@ibmin cc Subject [jira] Commented: (OPENJPA-1914) Issue with OpenJPA 1.2.1 while using subquery. [ https://issues.apache.org/jira/browse/OPENJPA-1914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977392#action_12977392 ] Fay Wang commented on OPENJPA-1914: --- According to the spec, the BNF of the in_expression, subquery are: in_expression ::= state_field_path_expression [NOT] IN ( in_item {, in_item}* | subquery) subquery ::= simple_select_clause subquery_from_clause [where_clause][groupby_clause] [having_clause] simple_select_clause ::= SELECT [DISTINCT] simple_select_expression As can be seen from the BNF, the LHS of the in_expression can be one and only one path expression and the subquery can select one and only one expression or variable. The where clause in your JPQL, therefore, is incorrect: WHERE (jrNbr.countryCode,jrNbr.sourceCode) NOT IN (SELECT vNbr.countryCode,vNbr.sourceCode FROM VoucherNumber vNbr,Country ctyEntity WHERE vNbr.countryCode = ctyEntity.cty AND ctyEntity.cln_identity=:clnIdentity)"; system. Working from standalone java program. using log4j-1.2.14.jar and geronimo-jpa_3.0_spec-1.0.jar jrNbr.updated_on=:updatedOn WHERE (jrNbr.countryCode,jrNbr.sourceCode) NOT IN(SELECT vNbr.countryCode,vNbr.sourceCode FROM VoucherNumber vNbr,Country ctyEntity WHERE vNbr.countryCode = ctyEntity.cty AND ctyEntity.cln_identity=:clnIdentity)"; org.apache.openjpa.persistence.ArgumentException: Encountered "jrNbr . countryCode ," at character 67, but expected: ["(", ")", "*", "+", "-", ".", "/", ":", "<", "<=", "<>", "=", ">", ">=", "?", "ABS", "ALL", "AND", "ANY", "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", , , , ]. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. > Issue with OpenJPA 1.2.1 while using subquery. > -- > > Key: OPENJPA-1914 > URL: https://issues.apache.org/jira/browse/OPENJPA-1914 > Project: OpenJPA > Issue Type: Bug >Affects Versions: 1.2.1 > Environment: Database server= DB2 z/OS 9.1.5 in AIX system. > Working from standalone java program. using log4j-1.2.14.jar and > geronimo-jpa_3.0_spec-1.0.jar >Reporter: JaiKumar > > On using below code to update an JournalNumber entity .. > tx = entityManager.getTransaction(); > tx.begin(); > System.out.println("...Clone :" + cloneId); > String query = "UPDATE JournalNumber jrNbr SET > jrNbr.updated_on=:updatedOn WHERE (jrNbr.countryCode,jr
[jira] Commented: (OPENJPA-1914) Issue with OpenJPA 1.2.1 while using subquery.
[ https://issues.apache.org/jira/browse/OPENJPA-1914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977605#action_12977605 ] JaiKumar commented on OPENJPA-1914: --- Thanks for the response, I understand from your statement that only one column can be used in Left hand side of NOT IN operator. And two columns cannot be supported as in original query. i.e, WHERE (jrNbr.countryCode) NOT IN (SELECT vNbr.countryCode FROM VoucherNumber vNbr,Country ctyEntity WHERE vNbr.countryCode = ctyEntity.cty AND ctyEntity.cln_identity=:clnIdentity)"; However the whole idea of using two columns on LHS of NOT IN operator came to me since its supported in DB2 Database with Native sql, for which OpenJPA ver 1.2.1 was failing .. Even its supported by most of other DB like oracle, sqlserver etc. and as well. Using a single table column will not provide similar results when you want to check two column data against single record. Native SQL which will work in client tools for most of database are provided below. UPDATE VITSCM.VITTBGE jnbr SET jnbr.updated_on=:updatedOn WHERE (jnbr.cty,jnbr.src) NOT IN(SELECT a.cty,a.src FROM VITSCF.CFLTBGE a,VITSCM.VITTCTY b WHERE a.cty = b.cty AND b.cln_identity=:clnIdentity) Please provide an alternative for this. > Issue with OpenJPA 1.2.1 while using subquery. > -- > > Key: OPENJPA-1914 > URL: https://issues.apache.org/jira/browse/OPENJPA-1914 > Project: OpenJPA > Issue Type: Bug >Affects Versions: 1.2.1 > Environment: Database server= DB2 z/OS 9.1.5 in AIX system. > Working from standalone java program. using log4j-1.2.14.jar and > geronimo-jpa_3.0_spec-1.0.jar >Reporter: JaiKumar > > On using below code to update an JournalNumber entity .. > tx = entityManager.getTransaction(); > tx.begin(); > System.out.println("...Clone :" + cloneId); > String query = "UPDATE JournalNumber jrNbr SET > jrNbr.updated_on=:updatedOn WHERE (jrNbr.countryCode,jrNbr.sourceCode) NOT > IN(SELECT vNbr.countryCode,vNbr.sourceCode FROM VoucherNumber vNbr,Country > ctyEntity WHERE vNbr.countryCode = ctyEntity.cty AND > ctyEntity.cln_identity=:clnIdentity)"; > Query q = entityManager.createQuery(query); > q.setParameter("updatedOn", new Date()); > q.setParameter("clnIdentity", cloneId); > q.executeUpdate(); > tx.commit(); > I get below error .. > > org.apache.openjpa.persistence.ArgumentException: Encountered "jrNbr . > countryCode ," at character 67, but expected: ["(", ")", "*", "+", "-", ".", > "/", ":", "<", "<=", "<>", "=", ">", ">=", "?", "ABS", "ALL", "AND", "ANY", > "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", > "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", > "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", > "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", > "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", > "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", > "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", , > , , ]. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.