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
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.
pgsql-general by date
|Next:||From: David Siebert||Date: 2008-06-25 16:33:24|
|Subject: Re: Probably been asked a hundred times before.|
|Previous:||From: Rodrigo Gonzalez||Date: 2008-06-25 14:45:59|
|Subject: ERROR: could not open relation with OID 2836|