-->
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.  [ 2 posts ] 
Author Message
 Post subject: Are Hibernate Collection wrappers thread-safe?
PostPosted: Wed Jun 28, 2006 6:34 pm 
Beginner
Beginner

Joined: Thu Dec 09, 2004 3:19 pm
Posts: 34
Hibernate version:
2.1

Are the Collection wrappers used by Hibernate multi-thread safe? If I have a Map loaded by Hibernate (e.g. an object has a map of properties). Is the Map thread safe for multiple simultaneous put() operations across different threads?

In most of my code I had used the various Collections.sychronizedXYZ() methods (and now the 1.5 concurrent collections). But with Hibernate, the Map/List is a wrapper set by Hibernate when the object is loaded. Presumably I don't want to lose the collection wrapper Hibernate has supplied?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 28, 2006 6:54 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
No, they're not. Synchronize any blocks that refer to collections that might be used in multiple threads.

_________________
Code tags are your friend. Know them and use them.


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

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.