ProgramixGenericLib v5.0.1

com.programix.da2.exception
Class StaleDataDAException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.programix.da2.exception.DAException
              extended by com.programix.da2.exception.DataStateDAException
                  extended by com.programix.da2.exception.StaleDataDAException
All Implemented Interfaces:
Serializable

public class StaleDataDAException
extends DataStateDAException

Used with Optimistic Concurrency Control to indicate that there has been an attempt to update a record with a stale version.

For example, assume that a shipping address record with an "update count" of 5 has been read by User A. While User A is editing this data, User B also reads version 5, edits the data, and then updates the record in the data store (and consequently the "update count" gets changed to 6). Now, when User A attempts to save his/her version of the record, the save fails by throwing a StaleDataException where getTarget() returns something like "shipping_address", getExpectedCount() returns 5, and getActualCount() returns 6. The textual message for StaleDataException also includes those three pieces of data.

Author:
Paul Hyde
See Also:
Serialized Form

Constructor Summary
StaleDataDAException()
           
StaleDataDAException(String message)
           
StaleDataDAException(String target, int expectedCount, int actualCount)
           
StaleDataDAException(String message, Throwable cause)
           
StaleDataDAException(Throwable cause)
           
 
Method Summary
 int getActualCount()
           
 int getExpectedCount()
           
 String getTarget()
           
 
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

StaleDataDAException

public StaleDataDAException(String target,
                            int expectedCount,
                            int actualCount)

StaleDataDAException

public StaleDataDAException()

StaleDataDAException

public StaleDataDAException(String message)

StaleDataDAException

public StaleDataDAException(String message,
                            Throwable cause)

StaleDataDAException

public StaleDataDAException(Throwable cause)
Method Detail

getTarget

public String getTarget()

getExpectedCount

public int getExpectedCount()

getActualCount

public int getActualCount()

ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.