My application is Non EJB application without CMP. I want to manage all transactions using hibernate.
I changed my hibernator generator class from HiLo to sequence. I also created in Oracle 9i a sequence object called uid_sequence that I specify in my hibernate mapping file (see below):
<hibernate-mapping>
<class name="model.vo.User" table="user_tbl" >
<id name="oid" type="long" column="user_id" unsaved-value="0" >
<generator class="sequence">
<param name="sequence">uid_sequence</param>
</generator>
</id>
<!-- Class variables mapping with table columns -->
<property name="title" column="user_title" type="string"/>
<property name="firstName" column="user_first_name" type="string"/>
<property name="lastName" column="user_last_name" type="string"/>
<property name="email" column="user_email" type="string"/>
<property name="birthDate" column="user_birth_date" type="string"/>
</class>
</hibernate-mapping>
Now I am able to insert however, but I get an exception from WAS as follows:
javax.servlet.ServletException: LocalTransaction rolled-back due to setRollbackOnly
at
com.ibm.ws.webcontainer.webapp.WebAppTransactionCollaborator.postInvok (WebAppTransactionCollaborator.java:224)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:671)
...
It is accompanied by:
WLTC0033E: Resource {0} rolled back in cleanup of unresolved LocalTransactionContainment.
and:
WLTC0032E: One or more resources rolled back. An unresolved LocalTransactionContainment had an unresolved action of rollback
Questions:
1) Why is WAS trying to rollback transaction?
2) How can I disable this so I have full control of transaction?
3) Has anyone deployed a simple webapp (Non-EJB) app using hibernate, WAS, and Oracle? If so please send me you hibernate.cfg.xml and mapping files or atleast guide me...
Thanks,
|