Hibernate 3.1 with Weblogic
Hello...
I'm using Hibernate withing an MDB in Weblogic. The problem is - data is not saved when save() is called on the Session.
Option show_sql is set to true.
When debugging - selects are shown correctly and data is retrieved. Updates are not being generated for some reason.
I have a feeling it's related to configuration somwhere that I might have missed, but I can't figure this out.
Please help
May hibernate connfigs:
<session-factory>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="current_session_context_class">jta</property>
<property name="session_factory_name">mcliHbSessionFactory</property>
<property name="connection.datasource">TVS</property>
<property name="dialect">org.hibernate.dialect.SybaseDialect</property>
<property name="jndi.class">weblogic.jndi.WLInitialContextFactory</property>
<property name="show_sql">true</property>
<mapping resource="IntTransact.hbm.xml" />
<mapping resource="IntRunlog.hbm.xml" />
<mapping resource="IntError.hbm.xml" />
.....
</session-factory>
</hibernate-configuration>
Code executing is pretty simple:
Code:
hbSession = HibernateUtils.getSessionFactory().getCurrentSession();
IntRunlog intRunlog = trans.getIntRunlog();
hbSession.saveOrUpdate(intRunlog);
EJB Configs are as follows:
<ejb-jar>
<enterprise-beans>
<message-driven>
<ejb-name>TvsTradeImportMDB</ejb-name>
<ejb-class>com.oppen.trd_import.ejb.TvsTradeImportEJB</ejb-class>
<transaction-type>Container</transaction-type>
<acknowledge-mode>Auto-acknowledge</acknowledge-mode>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>TvsTradeImportMDB</ejb-name>
<method-name>onMessage()</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>