-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: ThreadLocal Pattern with Standalone Application
PostPosted: Wed Sep 20, 2006 7:10 pm 
Newbie

Joined: Thu Aug 18, 2005 5:39 pm
Posts: 8
Hello,

I'm using Hibernate (using a caveatemptor style DAO pattern), in a standalone application. In my application there are TCP connections which remain open for a considerable amount of time to clients (hours at a time). If I demarcate the transaction boundary at the thread level, will the data not be persisted until the connection (and thus terminating the connection thread) is closed (triggering the end of the transaction)?

If this is the case, should I be manually beginning/ending the transactions where appropriate? i.e. everytime I touch a persisted entity. Or is there a way I can keep the transaction open until the connection thread ends but "flush" the persisted data (saving it to the DB) periodically?

I'd really like to demarcate my transaction boundary at the start of the connection thread and end it when the connection is closed, as this would be really clean. Or am I pushing the concept of a "unit of work" the transaction represents too far?

Any guidance would be appreciated.

Thanks in Advance,

Richard...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.