Module org.eclipse.persistence.core
Class DatabaseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.eclipse.persistence.exceptions.EclipseLinkException
org.eclipse.persistence.exceptions.DatabaseException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EISException
Purpose: Wrapper for any database exception that occurred through EclipseLink.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Accessor
protected Call
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected SQLException
protected boolean
static final int
protected DatabaseQuery
protected AbstractRecord
static final int
static final int
static final int
static final int
static final int
Fields inherited from class org.eclipse.persistence.exceptions.EclipseLinkException
CR, errorCode, hasBeenLogged, indentationString, internalException, session, shouldPrintInternalException
-
Constructor Summary
ModifierConstructorDescriptionprotected
INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code.protected
DatabaseException
(String message) INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code.protected
DatabaseException
(SQLException exception) INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code. -
Method Summary
Modifier and TypeMethodDescriptionstatic DatabaseException
static DatabaseException
configurationErrorClassNotFound
(String className) static DatabaseException
configurationErrorNewInstanceIllegalAccessException
(IllegalAccessException exception, Class<?> javaClass) static DatabaseException
configurationErrorNewInstanceInstantiationException
(InstantiationException exception, Class<?> javaClass) static DatabaseException
couldNotConvertObjectType
(int type) static DatabaseException
databaseAccessorConnectionIsNull
(DatabaseAccessor databaseAccessor, AbstractSession session) static DatabaseException
static DatabaseException
databaseAccessorNotConnected
(DatabaseAccessor databaseAccessor) static DatabaseException
static DatabaseException
static DatabaseException
PUBLIC: Return the accessor.getCall()
PUBLIC: Return the call that caused the exception.int
PUBLIC: This is the database error number.PUBLIC: This is the database error message.getQuery()
PUBLIC: This method returns the databaseQuery.PUBLIC: Return the query arguments used in the original query when exception is thrownboolean
static DatabaseException
static DatabaseException
void
setAccessor
(Accessor accessor) INTERNAL: Set the Accessor.void
INTERNAL: Set the call that caused the exception.void
setCommunicationFailure
(boolean isCommunicationFailure) void
setQuery
(DatabaseQuery query) PUBLIC: This method set the databaseQuery.void
setQueryArguments
(AbstractRecord queryArguments) PUBLIC: Set the query arguments used in the original query when exception is thrownstatic DatabaseException
specifiedLockingFieldsNotFoundInDatabase
(String lockingFieldName) static DatabaseException
sqlException
(SQLException exception) static DatabaseException
sqlException
(SQLException exception, boolean commError) static DatabaseException
sqlException
(SQLException exception, Accessor accessor, AbstractSession session, boolean isCommunicationFailure) static DatabaseException
sqlException
(SQLException exception, AbstractSession session, boolean commError) static DatabaseException
sqlException
(SQLException exception, Call call, Accessor accessor, AbstractSession session, boolean isCommunicationFailure) static DatabaseException
static DatabaseException
static DatabaseException
unableToAcquireConnectionFromDriverException
(String driver, String user, String url) The connection returned from this driver was null, the driver may be missing(using the default) or the wrong one for the database.static DatabaseException
unableToAcquireConnectionFromDriverException
(SQLException exception, String driver, String user, String url) The connection returned from this driver was null, the driver may be missing(using the default) or the wrong one for the database.Methods inherited from class org.eclipse.persistence.exceptions.EclipseLinkException
cr, getErrorCode, getIndentationString, getInternalException, getSession, getUnformattedMessage, hasBeenLogged, printStackTrace, printStackTrace, printStackTrace, setErrorCode, setHasBeenLogged, setIndentationString, setInternalException, setSession, setShouldPrintInternalException, shouldPrintInternalException, toString
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
Field Details
-
exception
-
call
-
query
-
queryArguments
-
accessor
-
isCommunicationFailure
protected boolean isCommunicationFailure -
SQL_EXCEPTION
public static final int SQL_EXCEPTION- See Also:
-
CONFIGURATION_ERROR_CLASS_NOT_FOUND
public static final int CONFIGURATION_ERROR_CLASS_NOT_FOUND- See Also:
-
DATABASE_ACCESSOR_NOT_CONNECTED
public static final int DATABASE_ACCESSOR_NOT_CONNECTED- See Also:
-
ERROR_READING_BLOB_DATA
public static final int ERROR_READING_BLOB_DATA- See Also:
-
COULD_NOT_CONVERT_OBJECT_TYPE
public static final int COULD_NOT_CONVERT_OBJECT_TYPE- See Also:
-
LOGOUT_WHILE_TRANSACTION_IN_PROGRESS
public static final int LOGOUT_WHILE_TRANSACTION_IN_PROGRESS- See Also:
-
SEQUENCE_TABLE_INFORMATION_NOT_COMPLETE
public static final int SEQUENCE_TABLE_INFORMATION_NOT_COMPLETE- See Also:
-
ERROR_PREALLOCATING_SEQUENCE_NUMBERS
public static final int ERROR_PREALLOCATING_SEQUENCE_NUMBERS- See Also:
-
CANNOT_REGISTER_SYNCHRONIZATIONLISTENER_FOR_UNITOFWORK
public static final int CANNOT_REGISTER_SYNCHRONIZATIONLISTENER_FOR_UNITOFWORK- See Also:
-
SYNCHRONIZED_UNITOFWORK_DOES_NOT_SUPPORT_COMMITANDRESUME
public static final int SYNCHRONIZED_UNITOFWORK_DOES_NOT_SUPPORT_COMMITANDRESUME- See Also:
-
CONFIGURATION_ERROR_NEW_INSTANCE_INSTANTIATION_EXCEPTION
public static final int CONFIGURATION_ERROR_NEW_INSTANCE_INSTANTIATION_EXCEPTION- See Also:
-
CONFIGURATION_ERROR_NEW_INSTANCE_ILLEGAL_ACCESS_EXCEPTION
public static final int CONFIGURATION_ERROR_NEW_INSTANCE_ILLEGAL_ACCESS_EXCEPTION- See Also:
-
TRANSACTION_MANAGER_NOT_SET_FOR_JTS_DRIVER
public static final int TRANSACTION_MANAGER_NOT_SET_FOR_JTS_DRIVER- See Also:
-
ERROR_RETRIEVE_DB_METADATA_THROUGH_JDBC_CONNECTION
public static final int ERROR_RETRIEVE_DB_METADATA_THROUGH_JDBC_CONNECTION- See Also:
-
COULD_NOT_FIND_MATCHED_DATABASE_FIELD_FOR_SPECIFIED_OPTOMISTICLOCKING_FIELDS
public static final int COULD_NOT_FIND_MATCHED_DATABASE_FIELD_FOR_SPECIFIED_OPTOMISTICLOCKING_FIELDS- See Also:
-
UNABLE_TO_ACQUIRE_CONNECTION_FROM_DRIVER
public static final int UNABLE_TO_ACQUIRE_CONNECTION_FROM_DRIVER- See Also:
-
DATABASE_ACCESSOR_CONNECTION_IS_NULL
public static final int DATABASE_ACCESSOR_CONNECTION_IS_NULL- See Also:
-
-
Constructor Details
-
DatabaseException
protected DatabaseException()INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code. -
DatabaseException
INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code. -
DatabaseException
INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code.
-
-
Method Details
-
cannotRegisterSynchronizatonListenerForUnitOfWork
-
configurationErrorClassNotFound
-
configurationErrorNewInstanceIllegalAccessException
public static DatabaseException configurationErrorNewInstanceIllegalAccessException(IllegalAccessException exception, Class<?> javaClass) -
configurationErrorNewInstanceInstantiationException
public static DatabaseException configurationErrorNewInstanceInstantiationException(InstantiationException exception, Class<?> javaClass) -
couldNotConvertObjectType
-
databaseAccessorNotConnected
-
databaseAccessorNotConnected
-
databaseAccessorConnectionIsNull
public static DatabaseException databaseAccessorConnectionIsNull(DatabaseAccessor databaseAccessor, AbstractSession session) -
errorPreallocatingSequenceNumbers
-
errorReadingBlobData
-
specifiedLockingFieldsNotFoundInDatabase
-
getAccessor
PUBLIC: Return the accessor. -
getDatabaseErrorCode
public int getDatabaseErrorCode()PUBLIC: This is the database error number. Since it is possible to have no internal exception the errorCode will be zero in this case. -
getMessage
PUBLIC: This is the database error message.- Overrides:
getMessage
in classEclipseLinkException
-
getQuery
PUBLIC: This method returns the databaseQuery. DatabaseQuery is a visible class to the EclipseLink user. Users create an appropriate query by creating an instance of a concrete subclasses of DatabaseQuery. -
getCall
PUBLIC: Return the call that caused the exception. -
setCall
INTERNAL: Set the call that caused the exception. -
getQueryArgumentsRecord
PUBLIC: Return the query arguments used in the original query when exception is thrown -
logoutWhileTransactionInProgress
-
sequenceTableInformationNotComplete
-
setAccessor
INTERNAL: Set the Accessor. -
setQuery
PUBLIC: This method set the databaseQuery. DatabaseQuery is a visible class to the EclipseLink user. Users create an appropriate query by creating an instance of a concrete subclasses of DatabaseQuery. -
setQueryArguments
PUBLIC: Set the query arguments used in the original query when exception is thrown -
sqlException
-
sqlException
-
sqlException
public static DatabaseException sqlException(SQLException exception, AbstractSession session, boolean commError) -
sqlException
public static DatabaseException sqlException(SQLException exception, Accessor accessor, AbstractSession session, boolean isCommunicationFailure) -
sqlException
public static DatabaseException sqlException(SQLException exception, Call call, Accessor accessor, AbstractSession session, boolean isCommunicationFailure) -
synchronizedUnitOfWorkDoesNotSupportCommitAndResume
-
transactionManagerNotSetForJTSDriver
-
errorRetrieveDbMetadataThroughJDBCConnection
-
unableToAcquireConnectionFromDriverException
public static DatabaseException unableToAcquireConnectionFromDriverException(String driver, String user, String url) The connection returned from this driver was null, the driver may be missing(using the default) or the wrong one for the database. -
unableToAcquireConnectionFromDriverException
public static DatabaseException unableToAcquireConnectionFromDriverException(SQLException exception, String driver, String user, String url) The connection returned from this driver was null, the driver may be missing(using the default) or the wrong one for the database. -
isCommunicationFailure
public boolean isCommunicationFailure() -
setCommunicationFailure
public void setCommunicationFailure(boolean isCommunicationFailure)
-