Skip site navigation (1) Skip section navigation (2)

Serialized Access

From: "Phillip Mills" <pmills(at)systemcore(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Serialized Access
Date: 2008-06-25 15:21:35
Message-ID: dd0408e50806250821h4ff11d4x607059249191bd1d@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
I'm working on an application that uses EJB3 entities in JBoss, with
Hibernate and a PostgreSQL database.  One of the entity tables needs
consistent, synchronized updates to rows in an environment where telling the
user that their operation failed and starting over is not an option.

Because it's the default, I've used EJB3's optimistic locking with a
strategy of catching EJBExceptions and retrying my updates.  Since
contention can be frequent, the overhead (and extra logic) for this seems
like a waste.  I would like to try pessimistic locking and compare the
results, but here's where my problem arises.  EJB documentation passes this
off to the application server, which considers it a ORM problem.  Hibernate
says it doesn't add any lock features beyond what JDBC and the database
provide....

In the end, I need Java code in a stateless bean that causes serialized
access to database rows that are under the control of an EntityManager, but
the approach to doing that is eluding me.

So, I'm not entirely sure this is a PostgreSQL question, but if not perhaps
someone can tell me which layer of this architecture *is* responsible.  :-)

Thanks in advance.

Responses

pgsql-general by date

Next:From: David SiebertDate: 2008-06-25 16:33:24
Subject: Re: Probably been asked a hundred times before.
Previous:From: Rodrigo GonzalezDate: 2008-06-25 14:45:59
Subject: ERROR: could not open relation with OID 2836

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group