does Tapestry-Hibernate
allow multiple Hibernate sessions? if not, any solution to this? Thanks.

Yes, you can grab the HibernateSessionSource and call create to get a second session.

You are responsible for this session, so make sure you close it.

Josh



On Apr 6, 2008, at 2:04 AM, Angelo Chen wrote:


Hi,

I have a need to generate a sequential ID for employee entity, the entity has its own primary key which is auto incremented. I use a one- record table that has a field 'next_id', every time when a new employee is added, I'll just get that record and increment the field, this works most of the time, but if there are multiple workstations adding new employees, problem will
happen, it will have this 'dead lock' issue. I'm thinking of
accessing/incrementing the one-record table to be in a separate Hibernate session, it will immediately flush after incrementing the 'next_id', this will leave a very small window for that record to be locked and allowing other workstations to continue, and question is, does Tapestry- Hibernate allow multiple Hibernate sessions? if not, any solution to this? Thanks.

Angelo
--
View this message in context: 
http://www.nabble.com/T5%3A-multiple-sessions-with-Tapestry-Hibernate--tp16522245p16522245.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to