thread safety of Teneo [message #120741] |
Wed, 30 April 2008 13:40  |
Eclipse User |
|
|
|
Hi Martin,
I'm using Teneo in a web service environment, so it is expected that
multiple threads will need to load and save objects to the database. I
know that the EMF model instances are only used in the thread that
creates them and that Hibernate is thread safe. Are there any Teneo
considerations I should be looking out for? I'm letting Teneo generate
the mapping when it starts up, but beyond that initial mapping does
Teneo even have any runtime concerns? What about HbDataStore? Can that
be shared by multiple threads?
Any thoughts or things to test would be much appreciated,
Jason Henriksen
|
|
|
Re: thread safety of Teneo [message #120750 is a reply to message #120741] |
Wed, 30 April 2008 13:58  |
Eclipse User |
|
|
|
Hi Jason,
Teneo also has a runtime part (mainly hibernate property accessors), but these should all be
thread-safe. The initialization of the datastore is not threadsafe, requesting
sessions/entitymanagers from the datastore is thread safe. So you can/should share one datastore in
multiple threads to get a thread-specific session or entitymanager. Hibernate
sessions/entitymanagers are not thread-safe (they are single-thread), but I am sure you are aware of
this.
Overall Teneo follows the same thread-safe behavior as hibernate.
gr. Martin
jason henriksen wrote:
> Hi Martin,
>
> I'm using Teneo in a web service environment, so it is expected that
> multiple threads will need to load and save objects to the database. I
> know that the EMF model instances are only used in the thread that
> creates them and that Hibernate is thread safe. Are there any Teneo
> considerations I should be looking out for? I'm letting Teneo generate
> the mapping when it starts up, but beyond that initial mapping does
> Teneo even have any runtime concerns? What about HbDataStore? Can that
> be shared by multiple threads?
>
> Any thoughts or things to test would be much appreciated,
>
> Jason Henriksen
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: thread safety of Teneo [message #617967 is a reply to message #120741] |
Wed, 30 April 2008 13:58  |
Eclipse User |
|
|
|
Hi Jason,
Teneo also has a runtime part (mainly hibernate property accessors), but these should all be
thread-safe. The initialization of the datastore is not threadsafe, requesting
sessions/entitymanagers from the datastore is thread safe. So you can/should share one datastore in
multiple threads to get a thread-specific session or entitymanager. Hibernate
sessions/entitymanagers are not thread-safe (they are single-thread), but I am sure you are aware of
this.
Overall Teneo follows the same thread-safe behavior as hibernate.
gr. Martin
jason henriksen wrote:
> Hi Martin,
>
> I'm using Teneo in a web service environment, so it is expected that
> multiple threads will need to load and save objects to the database. I
> know that the EMF model instances are only used in the thread that
> creates them and that Hibernate is thread safe. Are there any Teneo
> considerations I should be looking out for? I'm letting Teneo generate
> the mapping when it starts up, but beyond that initial mapping does
> Teneo even have any runtime concerns? What about HbDataStore? Can that
> be shared by multiple threads?
>
> Any thoughts or things to test would be much appreciated,
>
> Jason Henriksen
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Powered by
FUDForum. Page generated in 0.03914 seconds