-
1. Re: Jboss ignores custom datasource in persistence.xml?
rdewell Oct 28, 2005 3:08 PM (in response to rdewell)I should have mentioned: I realize that DefaultDS is used for other things in Jboss. The only reason I removed it temporarily was to easily illustrate through an exception that DefaultDS is trying to be used by a PAR that doesn't even reference DefaultDS, but a different datasource entirely.
Ryan -
2. Re: Jboss ignores custom datasource in persistence.xml?
rdewell Oct 28, 2005 7:29 PM (in response to rdewell)I found the solution, although I don't see it alluded to in the documentation or examples anywhere. I have to duplicate the JNDI name of the datasource twice in persistence.xml:
....
<jta-datasource>java:/brightDatasource</jta-datasource>
....
Previously I only specified <jta-datasource> thinking that would be sufficient. -
3. Re: Jboss ignores custom datasource in persistence.xml?
rdewell Oct 28, 2005 7:29 PM (in response to rdewell)Crap, that was supposed to post as:
<jta-datasource>java:/brightDatasource</jta-datasource> -
4. Re: Jboss ignores custom datasource in persistence.xml?
rdewell Oct 28, 2005 7:31 PM (in response to rdewell)Nevermind, this I tried disabling HTML but this still doesn't post correctly, so I'll spell it out. You have to also specifiy the custom property hibernate.connection.datasource to the exact same string as jta-datasource. This is the only way I found to not have hibernate use DefaultDS.
-
5. Re: Jboss ignores custom datasource in persistence.xml?
epbernard Oct 29, 2005 6:00 AM (in response to rdewell)Do a favor for me:
Find the %JBOSS_HOME%/server/myconfig/deploy/ejb3.deployer/META-INF/persistence.properties and comment the datasource line
#hibernate.connection.datasource=java:/DefaultDS
and the dialect one
#hibernate.dialect=org.hibernate.dialect.HSQLDialect
Does it works?