+1
Don't use autocommit. You might wind up changed pojo's where you've changed a 
couple properties yet never called/save/update commit etc.

Just specify transactional advice on your persistence manager.

Shame there is no way to specify spring transactional advice on pages/actions 
like other frameworks can.  Hopefully the next version of tapestry will take 
away that limitation.

 -----Original Message-----
From:   Konstantin Iignatyev [mailto:[EMAIL PROTECTED] 
Sent:   Friday, May 26, 2006 1:46 AM
To:     Tapestry users
Subject:        Re: Hibernate persisted data never makes it to DB

autocommit is not the best approach. I suggest you to have a glance at 
the article for inspiration
http://www.onjava.com/pub/a/onjava/2005/05/18/swingxactions.html?page=1

Mark wrote:
> I added "hibernate.connection.autocommit=true" to my 
> hibernate.properties and that fixed it...
>
> So I assume Spring by default does no Session/TX handling, unless I 
> use the HibernateTransactionManager or do programmatic transaction 
> handling...
> One last question, to get back to Tapestry - is Spring's 
> OpenSessionInViewFilter <OpenSessionInViewFilter.html> going to work 
> with Tapestry without limitations?
> I see all these posts about Tapernate and others, but I'm not sure 
> whether OpenSessionInViewFilter will work...
>
> Thanks,
>
> MARK
>
>
>
> Mark wrote:
>> Lutz Hühnken wrote:
>>> I asked for applicationContext.xml, and I get a mysql log... well,
>>> near enough :)
>> Sorry, I thought what I had found in the mysql log (the "set 
>> autocommit=0, no "commit" call and explicit "Rollback" call issued by 
>> Hibernate at shutdown) changed things a lot, but maybe not.
>>>> From your last mail I understand you have the same problem if you use
>>> the mysql command line client. 
>> No, the command line INSERT does make it, the records just don't get 
>> picked up by Hibernate...
>>> So generally, your sql statements never get committed... which is
>>> weird, because by default, mysql starts new connections with
>>> autocommit enabled.
>> No, only the ones coming from my webapp do not get committed.
>>>
>>> If you connect to mysql from the command line and do
>>> select @@autocommit;
>>> what do you get?
>> I get "1"
>>> Oh, and although the classname you use for the jdbc driver still
>>> works, since the mysql connector/j provides backwards compatibility in
>>> this respect, nowadays people tend to use "com.mysql.jdbc.Driver"
>>> because of a name change four years ago.
>> Ok, thanks, I changed that.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: [EMAIL PROTECTED] For 
> additional commands, e-mail: [EMAIL PROTECTED] 


-- 
Thanks,

Konstantin Ignatyev

http://www.kgionline.com





PS: If this is a typical day on planet earth, humans will add fifteen million 
tons of carbon to the atmosphere, destroy 115 square miles of tropical 
rainforest, create seventy-two miles of desert, eliminate between forty to one 
hundred species, erode seventy-one million tons of topsoil, add 2.700 tons of 
CFCs to the stratosphere, and increase their population by 263.000

Bowers, C.A.  The Culture of Denial:  
Why the Environmental Movement Needs a Strategy for Reforming Universities and 
Public Schools.  
New York:  State University of New York Press, 1997: (4) (5) (p.206)


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

This message, including any attachments, is intended only for the recipient(s) 
named above. It may contain confidential and privileged information. If you 
have 
received this communication in error, please notify the sender immediately and 
destroy or delete the original message. Also, please be aware that if you are 
not 
the intended recipient, any review, disclosure, copying, distribution or any 
action or reliance based on this message is prohibited by law.  


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

Reply via email to