ok, Howard, I added the bug to JIRA.

Regards.


Howard Lewis Ship wrote:
> 
> Before making changes, I'm checking on the Hibernate user forum.
> 
> http://forum.hibernate.org/viewtopic.php?p=2387715#2387715
> 
> Please still add the bug to JIRA.
> 
> On Wed, Jun 11, 2008 at 9:53 AM, Howard Lewis Ship <[EMAIL PROTECTED]>
> wrote:
>> Thanks for the heads up.
>>
>> Looking at the Hibernate source, I can see that this is true, when you
>> commit() a transaction, the Session's connection to the transaction
>> (via the JDBCContext) is lost.  It seems like, at least for the JDBC
>> case, the Transaction object should only have begin() invoked once.
>>
>> Please add a bug to JIRA; I'll change the source to invoke
>> session.beginTransaction() rather than Transaction.begin() after
>> commit or rollback.
>>
>> On Tue, Jun 10, 2008 at 5:30 PM, raulmt <[EMAIL PROTECTED]> wrote:
>>>
>>> Hi,
>>>
>>> I'm using T5.0.12, Hibernate 3.2.6GA and MySQL 5.1. I ran into a problem
>>> when I wanted to make two commits on the same request. The first commit
>>> worked fine, but the second works "partially" (for example, an entity
>>> deletion on the second transaction doesn't ocurr....).
>>>
>>> Debugging, I realized that before the first call to
>>> HibernateSessionManager.commit(), if I call
>>> hsm.getSession().getTransaction() (which gets the underlying transaction
>>> from the jdbcContext), the Transaction returned is the same instance
>>> that is
>>> stored in a property on the hsm, but after calling hsm.commit(),
>>> hsm.getSession().getTransaction() returns another instance of
>>> Transaction...
>>>
>>> I guess the problem is that hsm.commit() after committing the
>>> transaction it
>>> obtained when created the Session, instead of obtaining again the
>>> (apparently new) underlying transaction calling
>>> session.getTransaction(), it
>>> calls begin() on the same transaction it has stored on its property,
>>> which
>>> isn't the real underlying transaction and because of that, the
>>> transaction
>>> doesn't really begin again. If, after calling hsm.commit() I do a
>>> hsm.getSession().getTransaction().begin() (which I assume really starts
>>> another transaction on the database) all works perfectly.
>>>
>>> I'm not neither a Tapestry nor Hibernate expert, but I think maybe
>>> hsm.commit() should get again the transaction with
>>> session.getTransaction
>>> after it commits the current transaction.
>>>
>>> Regards.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/-T5--tapestry-hibernate-and-transactions-tp17767677p17767677.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator Apache Tapestry and Apache HiveMind
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-T5--tapestry-hibernate-and-transactions-tp17767677p17784231.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to