Is the CandleDAO thread safe with Hibernate?

View: New views
2 Messages — Rating Filter:   Alert me  

Is the CandleDAO thread safe with Hibernate?

by Wessel de Roode :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am wondering if I am using one instance of the candleDAO in multiple threads if I am going to kill meself if I am not using locking etc.. Does any body know if the Dao's are thread safe?
I am thinking of pushing in quotes from multiple threads into the db

Wessel

Re: Is the CandleDAO thread safe with Hibernate?

by Mike Kroutikov-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Should be thread-safe.
 
In more detail:
Spring's and Hibernate's session factories are thread-safe. Hibernate Session is not. As long as CandleDao opens hibernate session via factory and closes it before leaving dao method, dao is safe.
 
-Mike

On Mon, Aug 18, 2008 at 7:23 PM, Wessel de Roode <jwderoode2@...> wrote:

Hi,

I am wondering if I am using one instance of the candleDAO in multiple
threads if I am going to kill meself if I am not using locking etc.. Does
any body know if the Dao's are thread safe?
I am thinking of pushing in quotes from multiple threads into the db

Wessel
--
View this message in context: http://www.nabble.com/Is-the-CandleDAO-thread-safe-with-Hibernate--tp19041841p19041841.html
Sent from the ccapi2 and activeQuant mailing list archive at Nabble.com.

_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi


_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
LightInTheBox - Buy quality products at wholesale price!