[
http://jira.jboss.com/jira/browse/JBAS-4304?page=all ]
Adrian Brock updated JBAS-4304:
-------------------------------
Workaround Description:
A simple workaround is to add
<sync-on-commit-only/> to the entity descriptor in jboss.xml
However, this does mean that data will not be flushed until the transaction commits
which could mean that queries over the backend store are looking at old data.
Workaround: [Workaround Exists]
Jboss calls ejbStore "inside" ejbPostCreate on the same
entity.
---------------------------------------------------------------
Key: JBAS-4304
URL:
http://jira.jboss.com/jira/browse/JBAS-4304
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: EJB2
Affects Versions: JBossAS-4.0.4.GA
Environment: Windows XP Home/Pro, MySql or MSSQL as DB.
Reporter: Eugene Afonin
Assigned To: Scott M Stark
I beleive, I encountered a bug in jboss 4.0.4 GA.
We have an BMP entity bean(SWRecord in trace below) with a valueobject as an interface
with a client. Client can pass the valueobject to the ejbCreate method with incompletely
filled data. SWRecord fills missing data on ejbPostCreate, using several other beans by
their finders.
The problem is that findSingleObject causes the sync of the entities in the transaction
including bean that currently in ejbPostCreate - Jboss calls ejbStore on that bean.
I beleive, that's direct violation of EJB2 spec, since ejbStore could be called only
on bean in Ready state, and it can only be Ready after ejbPostCreate returns.
Here is a stacktrace taken from the ejbStore of non-created bean (I'm sure it's
the same entity - I checked with debugger).
Adrian Brock: I've snipped the stack trace to the relevant information and added
comments:
<!-- ejbStore() is invoked here -->
at com.supportwizard.dml.ejb.SWRecordBMP.ejbStore(SWRecordBMP.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jboss.ejb.plugins.BMPPersistenceManager.invokeEjbStore(BMPPersistenceManager.java:498)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeEjbStore(CachedConnection
Interceptor.java:294)
at org.jboss.ejb.EntityContainer.invokeEjbStore(EntityContainer.java:735)
at org.jboss.ejb.GlobalTxEntityMap$2.invokeEjbStore(GlobalTxEntityMap.java:132)
<!-- Because the GlobalTxEntityMap knows the context -->
at
org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:281)
at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap.java:208)
at
org.jboss.ejb.EntityContainer.synchronizeEntitiesWithinTransaction(EntityContainer.java:136)
<!-- The synchronization/flush occurs because of the finder -->
at org.jboss.ejb.EntityContainer.findSingleObject(EntityContainer.java:1100)
at org.jboss.ejb.EntityContainer.find(EntityContainer.java:721)
<!-- snipped -->
at $Proxy341.findByChildColumnID(Unknown Source)
at
com.supportwizard.dictionary.SWChoiceBean.getPossibleChoiceLines(SWChoiceBean.java:219)
<!-- Which is invoked from an SLSB -->
at $Proxy352.getPossibleChoiceLines(Unknown Source)
at
com.supportwizard.cachewrappers.SWChoiceCacheWrapper.getPossibleChoiceLines(SWChoiceCacheWrapper
.java:87)
<!-- Invoked from ejbPostCreate -->
at com.supportwizard.dml.ejb.SWRecordBean.ejbPostCreate(SWRecordBean.java:381)
<!--snipped-->
at $Proxy1189.create(Unknown Source)
at
com.supportwizard.dml.ejb.SWRecordCreatorBean.com$supportwizard$dml$ejb$SWRecordCreatorBean$crea
teRecord$aop(SWRecordCreatorBean.java:259)
--
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