User: danch
Date: 01/03/26 07:55:43
Modified: src/main/org/jboss/ejb/plugins/jaws/metadata
JawsEntityMetaData.java
Log:
Bill Burke's patch to do sql 'select ... for update' for smoother locking at the DB
level
Revision Changes Path
1.7 +10 -3
jboss/src/main/org/jboss/ejb/plugins/jaws/metadata/JawsEntityMetaData.java
Index: JawsEntityMetaData.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jaws/metadata/JawsEntityMetaData.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JawsEntityMetaData.java 2001/02/12 09:23:00 1.6
+++ JawsEntityMetaData.java 2001/03/26 15:55:43 1.7
@@ -34,7 +34,7 @@
* @see <related>
* @author <a href="[EMAIL PROTECTED]">Sebastien Alborini</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Dirk Zimmermann</a>
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public class JawsEntityMetaData extends MetaData implements XmlLoadable {
// Constants -----------------------------------------------------
@@ -60,6 +60,9 @@
// do we use tuned updates?
private boolean tunedUpdates;
+ // do we use 'SELECT ... FOR UPDATE' syntax?
+ private boolean selectForUpdate;
+
// is the bean read-only?
private boolean readOnly;
private int timeOut;
@@ -194,8 +197,8 @@
public Iterator getEjbReferences() { return entity.getEjbReferences(); }
public String getPrimKeyField() { return entity.getPrimKeyField(); }
-
+ public boolean hasSelectForUpdate() { return selectForUpdate; }
// XmlLoadable implementation ------------------------------------
@@ -227,7 +230,11 @@
// read only? If not provided, keep default.
String roStr = getElementContent(getOptionalChild(element,
"read-only"));
if (roStr != null) readOnly = Boolean.valueOf(roStr).booleanValue();
-
+
+ String sForUpStr = getElementContent(getOptionalChild(element,
"select-for-update"));
+ if (sForUpStr != null) selectForUpdate =
(Boolean.valueOf(sForUpStr).booleanValue());
+ selectForUpdate = selectForUpdate && !readOnly;
+
// read only timeout?
String toStr = getElementContent(getOptionalChild(element,
"time-out"));
if (toStr != null) timeOut = Integer.valueOf(toStr).intValue();
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development