Hi,
I'm using Hibernate v2.1.7 with Weblogic, and is it required (or any advantage) to use JTA with weblogic? I have my datasource setup in database, but I did not specify a transaction factory. Here is currently how my Hibernate.cfg.xml is setup:
Code:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory>
<!-- Bind the SesssionFactory to JNDI -->
<!-- JNDI DataSource Connection -->
<property name="connection.datasource">myDataSource</property>
<!-- Miscellaneous Properties -->
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<!-- Print SQL to stdout. -->
<property name="show_sql">true</property>
<!-- mapping files -->
</session-factory>
</hibernate-configuration>
When I run some tests, my data is inserted into the database, but I continue to get this error:
Code:
SEVERE: Could not toggle autocommit
net.sf.hibernate.HibernateException: Session is closed
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3327)
at net.sf.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:104)
at net.sf.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:95)
I'm confused - can someone please help? Is it better/required to specify the JTATransactionFactory?