[
https://jira.jboss.org/jira/browse/JBAS-5831?page=com.atlassian.jira.plug...
]
Alexey Loubyansky closed JBAS-5831.
-----------------------------------
Fix Version/s: JBossAS-5.0.0.CR2
JBossAS-4.2.4.GA
Resolution: Rejected
It's a configuration issue, not a bug, so the resolution is 'Rejected'.
I've added a commented out attribute for the entity-command which should be used in
case of XADataSource.
mysql-get-generated-keys does not work with xa datasource
---------------------------------------------------------
Key: JBAS-5831
URL:
https://jira.jboss.org/jira/browse/JBAS-5831
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: EJB2
Affects Versions: JBossAS-4.2.3.GA
Environment: MySQL Server 5.0, MySQL Connector/J 5.0.8
Reporter: Bart Vanhaute
Assignee: Alexey Loubyansky
Fix For: JBossAS-5.0.0.CR2, JBossAS-4.2.4.GA
An CMP 2.0 entity is configured with an <auto-increment/> and <entity-command
name="mysql-get-generated-keys"/>. The entity is packaged inside an -ejb.jar
and this .jar is packaged into an .ear.
The data source is an xa-datasource (com.mysql.jdbc.jdbc2.optional.MysqlXADataSource).
When I try to create a new entity, I get an exception:
java.lang.IllegalArgumentException: object is not an instance of declaring class
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:585)
at
org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCMySQLCreateCommand.executeInsert(JDBCMySQLCreateCommand.java:116)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:321)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:151)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:587)
at
org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:237)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:225)
at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:625)
at sun.reflect.GeneratedMethodAccessor297.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1126)
at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105)
at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:203)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:189)
at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105)
at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:136)
at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:76)
at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:45)
at
org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125)
... 212 more
The same code runs fine when the datasource is a not an xa data source.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira