[jira] [Commented] (OPENJPA-2443) InvalidStateException while merging a new Entity with a GeneratedValue id

2013-10-24 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/OPENJPA-2443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13804184#comment-13804184
 ] 

ASF subversion and git services commented on OPENJPA-2443:
--

Commit 1535379 from [~curtisr7] in branch 'openjpa/branches/2.3.x'
[ https://svn.apache.org/r1535379 ]

OPENJPA-2443 : Fix SingleFieldManager to not check for null values for IDENTITY 
generated fields when flushing.

 InvalidStateException while merging a new Entity with a GeneratedValue id
 -

 Key: OPENJPA-2443
 URL: https://issues.apache.org/jira/browse/OPENJPA-2443
 Project: OpenJPA
  Issue Type: Bug
  Components: kernel
Affects Versions: 2.3.0, 2.4.0
Reporter: Rick Curtis
Assignee: Rick Curtis
 Attachments: OPENJPA-2443.patch


 This problem only happens if you have an Entity with a Generated id that also 
 has the annotation @Basic(optional = false). If you create a new Entity and 
 then try to persist it via EntityManager.merge(...) call, you'll get the 
 following stack :
 openjpa-0.0.0-rnull fatal user error 
 org.apache.openjpa.persistence.InvalidStateException: The field id of 
 instance 
 org.apache.openjpa.persistence.jdbc.auto.AutoIncrementEntity@99883308 
 contained a null value; the metadata for this field specifies that nulls are 
 illegal.
   at 
 org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:567)
   at 
 org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:511)
   at 
 org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:3019)
   at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:44)
   at 
 org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:1035)
   at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2141)
   at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2101)
   at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1872)
   at 
 org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1045)
   at 
 org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:663)



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (OPENJPA-2443) InvalidStateException while merging a new Entity with a GeneratedValue id

2013-10-24 Thread Rick Curtis (JIRA)

[ 
https://issues.apache.org/jira/browse/OPENJPA-2443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13804186#comment-13804186
 ] 

Rick Curtis commented on OPENJPA-2443:
--

I merged the changes back to 2.3.x.

 InvalidStateException while merging a new Entity with a GeneratedValue id
 -

 Key: OPENJPA-2443
 URL: https://issues.apache.org/jira/browse/OPENJPA-2443
 Project: OpenJPA
  Issue Type: Bug
  Components: kernel
Affects Versions: 2.3.0, 2.4.0
Reporter: Rick Curtis
Assignee: Rick Curtis
 Fix For: 2.3.0, 2.4.0

 Attachments: OPENJPA-2443.patch


 This problem only happens if you have an Entity with a Generated id that also 
 has the annotation @Basic(optional = false). If you create a new Entity and 
 then try to persist it via EntityManager.merge(...) call, you'll get the 
 following stack :
 openjpa-0.0.0-rnull fatal user error 
 org.apache.openjpa.persistence.InvalidStateException: The field id of 
 instance 
 org.apache.openjpa.persistence.jdbc.auto.AutoIncrementEntity@99883308 
 contained a null value; the metadata for this field specifies that nulls are 
 illegal.
   at 
 org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:567)
   at 
 org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:511)
   at 
 org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:3019)
   at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:44)
   at 
 org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:1035)
   at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2141)
   at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2101)
   at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1872)
   at 
 org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1045)
   at 
 org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:663)



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (OPENJPA-2443) InvalidStateException while merging a new Entity with a GeneratedValue id

2013-10-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/OPENJPA-2443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13802973#comment-13802973
 ] 

ASF subversion and git services commented on OPENJPA-2443:
--

Commit 1535067 from [~curtisr7] in branch 'openjpa/trunk'
[ https://svn.apache.org/r1535067 ]

OPENJPA-2443 : Fix SingleFieldManager to not check for null values for IDENTITY 
generated fields when flushing.

 InvalidStateException while merging a new Entity with a GeneratedValue id
 -

 Key: OPENJPA-2443
 URL: https://issues.apache.org/jira/browse/OPENJPA-2443
 Project: OpenJPA
  Issue Type: Bug
  Components: kernel
Affects Versions: 2.3.0, 2.4.0
Reporter: Rick Curtis
Assignee: Rick Curtis
 Attachments: OPENJPA-2443.patch


 This problem only happens if you have an Entity with a Generated id that also 
 has the annotation @Basic(optional = false). If you create a new Entity and 
 then try to persist it via EntityManager.merge(...) call, you'll get the 
 following stack :
 openjpa-0.0.0-rnull fatal user error 
 org.apache.openjpa.persistence.InvalidStateException: The field id of 
 instance 
 org.apache.openjpa.persistence.jdbc.auto.AutoIncrementEntity@99883308 
 contained a null value; the metadata for this field specifies that nulls are 
 illegal.
   at 
 org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:567)
   at 
 org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:511)
   at 
 org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:3019)
   at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:44)
   at 
 org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:1035)
   at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2141)
   at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2101)
   at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1872)
   at 
 org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1045)
   at 
 org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:663)



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (OPENJPA-2443) InvalidStateException while merging a new Entity with a GeneratedValue id

2013-10-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/OPENJPA-2443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13803072#comment-13803072
 ] 

ASF subversion and git services commented on OPENJPA-2443:
--

Commit 1535082 from [~curtisr7] in branch 'openjpa/trunk'
[ https://svn.apache.org/r1535082 ]

OPENJPA-2443 : Remove unnecessary import.

 InvalidStateException while merging a new Entity with a GeneratedValue id
 -

 Key: OPENJPA-2443
 URL: https://issues.apache.org/jira/browse/OPENJPA-2443
 Project: OpenJPA
  Issue Type: Bug
  Components: kernel
Affects Versions: 2.3.0, 2.4.0
Reporter: Rick Curtis
Assignee: Rick Curtis
 Attachments: OPENJPA-2443.patch


 This problem only happens if you have an Entity with a Generated id that also 
 has the annotation @Basic(optional = false). If you create a new Entity and 
 then try to persist it via EntityManager.merge(...) call, you'll get the 
 following stack :
 openjpa-0.0.0-rnull fatal user error 
 org.apache.openjpa.persistence.InvalidStateException: The field id of 
 instance 
 org.apache.openjpa.persistence.jdbc.auto.AutoIncrementEntity@99883308 
 contained a null value; the metadata for this field specifies that nulls are 
 illegal.
   at 
 org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:567)
   at 
 org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:511)
   at 
 org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:3019)
   at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:44)
   at 
 org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:1035)
   at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2141)
   at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2101)
   at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1872)
   at 
 org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1045)
   at 
 org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:663)



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (OPENJPA-2443) InvalidStateException while merging a new Entity with a GeneratedValue id

2013-10-23 Thread Mark Struberg (JIRA)

[ 
https://issues.apache.org/jira/browse/OPENJPA-2443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13803519#comment-13803519
 ] 

Mark Struberg commented on OPENJPA-2443:


Rick, if you like then you might also apply this to the 2.3.x branch. Seems 
save for me to do so.

 InvalidStateException while merging a new Entity with a GeneratedValue id
 -

 Key: OPENJPA-2443
 URL: https://issues.apache.org/jira/browse/OPENJPA-2443
 Project: OpenJPA
  Issue Type: Bug
  Components: kernel
Affects Versions: 2.3.0, 2.4.0
Reporter: Rick Curtis
Assignee: Rick Curtis
 Attachments: OPENJPA-2443.patch


 This problem only happens if you have an Entity with a Generated id that also 
 has the annotation @Basic(optional = false). If you create a new Entity and 
 then try to persist it via EntityManager.merge(...) call, you'll get the 
 following stack :
 openjpa-0.0.0-rnull fatal user error 
 org.apache.openjpa.persistence.InvalidStateException: The field id of 
 instance 
 org.apache.openjpa.persistence.jdbc.auto.AutoIncrementEntity@99883308 
 contained a null value; the metadata for this field specifies that nulls are 
 illegal.
   at 
 org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:567)
   at 
 org.apache.openjpa.kernel.SingleFieldManager.preFlush(SingleFieldManager.java:511)
   at 
 org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:3019)
   at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:44)
   at 
 org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:1035)
   at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2141)
   at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2101)
   at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1872)
   at 
 org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:1045)
   at 
 org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:663)



--
This message was sent by Atlassian JIRA
(v6.1#6144)