On Mar 17, 2009, at 5:11 AM, <[email protected]> <[email protected]
> wrote:
Hi David,
I send you my ejb-jar.xml and hibernate.cfg.xml.
The ejb-jar.xml is based on the ejb-jar.xml from the jbpm-
enterprise.jar. I only add the messaging-type and changed some JNDI
names. The hibernate.cfg.xml is also based on default configuration
from jbpm. I only add the hibernate.connection.datasource property.
I also add the jbpm.cfg.xml defining the
JtaDbPersistenceServiceFactory, as mentioned in the documentation.
I hope the files helps to get more light in this problem.
I think I see something. Looking at this section of the ejb-jar.xml
<resource-ref>
<description>
Logical name of the data source that provides connections
to the persistence service. Must
match the hibernate.connection.datasource property in the
Hibernate configuration file.
</description>
<!-- CHANGES <res-ref-name>jdbc/JbpmDataSource</res-ref-name>
-->
<res-ref-name>TestDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Based on that comment, the hibernate.connection.datasource should be
configured like so:
<!-- DataSource properties (begin) -->
<property name="hibernate.connection.datasource">java:comp/env/
TestDS</property>
<!-- DataSource properties (end) -->
Also, I'm not too sure about this last comment but it seems strange to
have the "hibernate.connection.driver_class" and other JDBC related
properties set in addition to using a container supplied datasource.
I'm used to seeing this as a one or the other kind of thing: either
you're in a managed environment and use a datasource or in a non-
managed environment and create connections yourself. I know that when
doing the same with OpenJPA it will cause problems, not sure if the
same applies with Hibernate.
-David