[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2259) autoflush and autoclose not longer occur in JTA environment with hibernate 3.2
Ulrich Winter (JIRA)
noreply at atlassian.com
Wed Nov 22 03:10:04 EST 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2259?page=comments#action_25404 ]
Ulrich Winter commented on HHH-2259:
------------------------------------
No I didn't.
With hibernate 3.0.5 the autoflush was working without that.
[Environment] Hibernate 3.0.5
[TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
After setting that property with hibernate 3.2.0 it also flushes the session in beforeCompletion().
hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
I thought that setting
hibernate.current_session_context_class=org.hibernate.context.JTASessionContext
was enough to activate JTA behavior, because the javadoc of JTASessionContext says
"Note that the sessions returned from this method are automatically configured with both the auto-flush and auto-close attributes set to true."
But that assumption was probably wrong.
So it's not a bug but a slightly changed behavior in 3.2.0-ga.
> autoflush and autoclose not longer occur in JTA environment with hibernate 3.2
> ------------------------------------------------------------------------------
>
> Key: HHH-2259
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2259
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.2.0.ga, 3.2.1
> Environment: jboss 4.0.5
> Reporter: Ulrich Winter
>
>
> In a setup using JTASessionContext flush() and close() should occur automatically at the end of the transaction.
> This works with hibernate 3.0.5 but does not with hibernate 3.2.0-ga and 3.2.1-ga.
> Setup:
> hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
> hibernate.current_session_context_class=org.hibernate.context.JTASessionContext
> hibernate.transaction.flush_before_completion=true
> hibernate.transaction.auto_close_session=true
> Usage:
> public void doSomeWork() throws Exception {
> TransactionManager tm = (TransactionManager) Locator.lookup("java:/TransactionManager");
> tm.begin();
> Session session = sf.getCurrentSession();
> PersistentObject data = new PersistentObject ();
> data.setXYZ("xyz");
> session.save(data);
> tm.commit();
> }
> Symptom:
> no inserts/updates/deletes, only "select xxx.nextval()" occur to the database.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list