-->
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.  [ 3 posts ] 
Author Message
 Post subject: UserType
PostPosted: Tue Feb 17, 2004 8:18 am 
Beginner
Beginner

Joined: Fri Jan 16, 2004 11:05 am
Posts: 33
I have created a few of these, but I have not seen any documentation on how it is referenced internally. Is it safe to use member variables in these classes? Would/should there be a case that any of the functions ( ie nullSafeSet, nullSafeGet ) are synchronized?

Thanks in advance for any information, the help is much appreciated.


Top
 Profile  
 
 Post subject: Re: UserType
PostPosted: Tue Feb 17, 2004 8:23 am 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
tzman wrote:
Is it safe to use member variables in these classes?


Currently, yes it is safe. Hibernate will create a new instance every time the UserType is referenced in the mapping document.

Unfortunately, as you said, the API doesn't say anything about this behavior. Not written in the API, so be careful...

Quote:
Would/should there be a case that any of the functions ( ie nullSafeSet, nullSafeGet ) are synchronized?


I don't think so. The Hibernate Session cannot be shared by multiple threads - and afaik Hibernate is not multithreaded. Therefore can't see any reasons why you should protect your methods with the synchronize keyword.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 10:22 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hibernate is thread safe in SessionFactory

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.