As I said this will slow things down, but if you use a commit option which causes an ejbLoad() for every transaction which I think is option C, then in your ejbLoad() code execute your "select ... from ... where ..." with the additional clause on the end "for update of ..." where "..." is one or more fields in the object then you will have locked the row for the duration of the transaction in the database.  When JBoss commits the transaction then the database will unlock the row.  I don't know that SELECT...FOR UPDATE is supported by all the mickey mouse databases like Hypersonic and the like, but it should be supported by anything you'd use on a production site.
 
Cheers
Jay Walters
-----Original Message-----
From: Javier Gallardo [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 05, 2001 3:17 AM
To: jBoss
Subject: Re: [jBoss-User] Locking registry

How?  Has you a example?

Jay Walters wrote:
[EMAIL PROTECTED]" type="cite">
select .... for update could be used to lock on read during the ejbLoad() method.  Note this could really slow things down.
 
Cheers
Jay Walters
-----Original Message-----
From: Javier Gallardo [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 04, 2001 9:52 AM
To: jBoss
Subject: Re: [jBoss-User] Locking registry

How can we lock a table row (database) in jboss?

Rickard �berg wrote:
[EMAIL PROTECTED]" type="cite">
Hi!

Javier Gallardo wrote:
How can we lock a registry in jboss or via database?

What is a "registry" and how do you want to lock it?

/Rickard



Reply via email to