[JBoss JIRA] Resolved: (EJBTHREE-553) PrePersist callback method not called if entity's primery key is null
by Emmanuel Bernard (JIRA)
[ http://jira.jboss.com/jira/browse/EJBTHREE-553?page=all ]
Emmanuel Bernard resolved EJBTHREE-553.
---------------------------------------
Fix Version/s: EJB 3.0 RC11 - FD
Resolution: Done
Assignee: Emmanuel Bernard
http://opensource.atlassian.com/projects/hibernate/browse/EJB-46
Fixed in HEM 3.2.2
> PrePersist callback method not called if entity's primery key is null
> ---------------------------------------------------------------------
>
> Key: EJBTHREE-553
> URL: http://jira.jboss.com/jira/browse/EJBTHREE-553
> Project: EJB 3.0
> Issue Type: Bug
> Environment: jboss-4.0.4.CR2
> Reporter: Michal Borowiecki
> Assigned To: Emmanuel Bernard
> Fix For: EJB 3.0 RC11 - FD
>
> Attachments: EJB3EventListener_v2.patch
>
>
> When an entity is persisted which does not have its primary key set (and it is not annotated with GeneratedValue annotation), the @PrePersist callback method is not invoked.
> Instead the exception is thrown:
> Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): com.bluemedia.system.User
> at org.hibernate.id.Assigned.generate(Assigned.java:33)
> at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:98)
> at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
> at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
> at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
> at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:617)
> at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:591)
> at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:595)
> at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:187)
> ... 64 more
> This is in conflict with ejb 3.0-pfd spec, which states (sec. 3.4.2) :
> "The PrePersist and PreRemove callback methods are invoked for a given entity before the respective EntityManager persist and remove operations for that entity are executed."
> Since the spec states that EntityManager's persist operation is executed after the PrePersist callback methods, setting the value of the primary key in a PrePersist callback method seems a reasonable use case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months
[JBoss JIRA] Created: (JBAS-3776) Update SerialVersionUIDUnitTestCase to test against new versions
by Ryan Campbell (JIRA)
Update SerialVersionUIDUnitTestCase to test against new versions
----------------------------------------------------------------
Key: JBAS-3776
URL: http://jira.jboss.com/jira/browse/JBAS-3776
Project: JBoss Application Server
Issue Type: Task
Security Level: Public (Everyone can see)
Components: Test Suite
Reporter: Ryan Campbell
Priority: Critical
Fix For: JBossAS-4.0.6.CR1
Here is how to build the .ser database of serialVersionUIDs:
Builid jboss-4.0.5 with jdk14
cd build/output
java -XX:MaxPermSize=512m -Xmx2000m -cp ../../varia/output/classes org.jboss.tools.SerialVersionUID jboss-4.0.5.GA/
cp serialuid.ser $WORK/Branch_4_0/testsuite/src/etc/serialVersionUID/405.ser
Then the SerialVersionUIDUnitTestCase needs to be updated to test against 4.0.3SP1, 4.0.4, and 4.0.5.
The badpackages list will probably need to be different for each version.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months
[JBoss JIRA] Created: (JBAS-3838) ServerInfo does not check response from getThreadInfo for null
by Darran Lofthouse (JIRA)
ServerInfo does not check response from getThreadInfo for null
--------------------------------------------------------------
Key: JBAS-3838
URL: http://jira.jboss.com/jira/browse/JBAS-3838
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: MicroContainer bus
Affects Versions: JBossAS-4.0.5.GA
Reporter: Darran Lofthouse
Assigned To: Darran Lofthouse
Fix For: JBossAS-4.2.0.CR1
The ServerInfo MBean does not check the response from getThreadInfo for null. If getThreadInfo is called for a thread that no longer exists it returns null. Currently it is possible for the following NullPointerException to be logged: -
java.lang.NullPointerException
at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.system.server.ServerInfo.getThreadCpuUtilization(ServerInfo.java:557)
at org.jboss.system.server.ServerInfo.listThreadCpuUtilization(ServerInfo.java:510)
at sun.reflect.GeneratedMethodAccessor113.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months