db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r581411 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java
Date Tue, 02 Oct 2007 22:08:23 GMT
Author: arminw
Date: Tue Oct  2 15:08:22 2007
New Revision: 581411

URL: http://svn.apache.org/viewvc?rev=581411&view=rev
Log:
improve OptimisticLockException logging

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java?rev=581411&r1=581410&r2=581411&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java
Tue Oct  2 15:08:22 2007
@@ -30,6 +30,7 @@
 import java.util.Map;
 
 import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang.SystemUtils;
 import org.apache.ojb.broker.Identity;
 import org.apache.ojb.broker.OptimisticLockException;
 import org.apache.ojb.broker.PersistenceBrokerException;
@@ -125,8 +126,12 @@
             if (stmt.executeUpdate() == 0 && cld.isLocking()) //BRJ
             {
                 postHandleBatchProcess(batchSetting);
-                throw new OptimisticLockException("Delete failed, object of class " + obj.getClass().getName()
-                        + " has been modified by someone else, locking fields: "
+                throw new OptimisticLockException("Delete failed for " + SystemUtils.LINE_SEPARATOR
+                        + obj.getClass().getName() + SystemUtils.LINE_SEPARATOR
+                        + "object has been modified by someone else." + SystemUtils.LINE_SEPARATOR
+                        +"Locking values are: "
+                        + ArrayUtils.toString(cld.getCurrentLockingValues(obj)) + SystemUtils.LINE_SEPARATOR
+                        + "Locking fields are: "
                         + ArrayUtils.toString(cld.getLockingFields()), obj);
             }
             postHandleBatchProcess(batchSetting);
@@ -543,8 +548,12 @@
             if ((stmt.executeUpdate() == 0) && cld.isLocking()) //BRJ
             {
                 postHandleBatchProcess(batchSetting);
-                throw new OptimisticLockException("Update failed, object of class " + obj.getClass().getName()
-                        + " has been modified by someone else, locking fields: "
+                throw new OptimisticLockException("Update failed for " + SystemUtils.LINE_SEPARATOR
+                        + obj.getClass().getName() + SystemUtils.LINE_SEPARATOR
+                        + "object has been modified by someone else." + SystemUtils.LINE_SEPARATOR
+                        +"Locking values are: "
+                        + ArrayUtils.toString(cld.getCurrentLockingValues(obj)) + SystemUtils.LINE_SEPARATOR
+                        + "Locking fields are: "
                         + ArrayUtils.toString(cld.getLockingFields()), obj);
             }
             postHandleBatchProcess(batchSetting);



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message