EAF 7.6 API

com.lutris.appserver.server.sql
Class DBRowUpdateException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.sql.SQLException
              extended by com.lutris.appserver.server.sql.DBRowUpdateException
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<java.lang.Throwable>

public class DBRowUpdateException
extends java.sql.SQLException

DBRowUpdateException is thrown when a CoreDO update fails. Two values are used to uniquely identify a row in a table: oId and version. The executeUpdate() method creates an SQL UPDATE command to write the new values in a CoreDO object back to the correct row in the database. The row is identifed by the oId and version values specified in the WHERE-clause of the UPDATE command. So, if no row has the specified oId and version combination, the UPDATE will fail, and report that 0 rows were updated. Note: other database problems (e.g. disk full) can also cause an UPDATE to fail, but these are rare. When versioning == true, the executeUpdate() method will increment the version number in both the CoreDO object and in the updated row. When the same oId/version combination is used twice to create two CoreDO objects (A and B) that refer to the same row, it is possible for the version number of one of those objects to become out-of-sync with the row in the database. Object A is updated, and the version number in object A and in the row is incremented. When an attempt is made to update object B, the version number in object B no longer matches the row in the database, so the row is not found, and the update has no effect (zero rows are updated). In this case, the CoreDO.executeUpdate() method throws a DBRowUpdateException describing the problem. The application code that catches this exception should probably reload the Data Object from the database.

Version:
$Revision: 1.1 $
Author:
Jay Gunter
See Also:
CoreDO, Serialized Form

Constructor Summary
DBRowUpdateException(java.lang.String msg)
          Construct a exception without a specified cause.
DBRowUpdateException(java.lang.String msg, java.lang.Exception e)
           
 
Method Summary
 
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, iterator, setNextException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBRowUpdateException

public DBRowUpdateException(java.lang.String msg)
Construct a exception without a specified cause.

Parameters:
msg - The message associated with the exception.

DBRowUpdateException

public DBRowUpdateException(java.lang.String msg,
                            java.lang.Exception e)

EAF 7.6 API