Quote:
- We are not completely stand alone, we use Hibernate + JOTM on Tomcat 6.0.
Also I deploy my application as servlet on tomcat.
From this point of view this hiberante configuration is to consider standalone anyway
as it is not deployed in a managed ebj3 environment.
Code:
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">wewillwin</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/YouDB</property>
<property name="hibernate.connection.username">root</property>
These properties above belong to a JDBC configuration (JDBCTransactionFactory) and have
no sense in a JTA environment (JTATransactionFactory).
You should remove this entries.
In a JTA environment YOU MUST REFER TO A DATASOURCE instead in your configuration.
Code:
<session-factory name="hibernate/YouDBSessionFactory">
If I remember right, hibernate tries to bind the sessionfactory to JDNI if you specify a session-factory name.
You don't need that, and moreover the binding can/will easily fail with certain JNDI-implementations.
Therefore: don't specify a name for the session factory
Code:
<session-factory>
Quote:
- But commit/rollback does not happen.
As I explained in the posting before, it is of fundamental importance to get the datasource jta-aware,
otherwise only DML-statements are propagated to the database but no commit/rollback.
Please take a deeper look a the examples in the linked article, especially the point where the datasource is defined.
All what's different in the examples in comparison to your environment,
is that they use JPA approach (= persistence.xml configuration file) whilst you use the classical hibernate configuration.
(just look for, how to refer a datasource in classical hibernate configuration)