Oracle TopLink Developer's Guide
10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
ValidationException
is a development exception that is raised when an incorrect state is detected or an API is used incorrectly.
Format
EXCEPTION [TOPLINK – error code]: Exception name EXCEPTION DESCRIPTION: Message
Example 13-7 Validation Exception
EXCEPTION [TOPLINK – 7008]: oracle.toplink.exceptions.ValidationException EXCEPTION DESCRIPTION: The Java type javaClass is not a valid database type. The Java type of the field to be written to the database has no corresponding type on the database.
login
method on your server session or database session. This error also appears in multi threaded environments as a result of concurrency issues. Check that all your threads are synchronized.
addConnectionPool(String poolName,
JDBCLogin
login, int minNumberOfConnections
, int maxNumberOfConnections)
method on the server session.
addConnectionPool(String poolName,
JDBCLogin login, int minNumberOfConnections, int maxNumberOfConnections)
on server session. This method should be called before logging in on the server session.
commit
method on an invalid (or previously committed) unit of work.
If cannotCommitUOWAgain
method of ValidationException appears in the stack trace, verify that the commit
method was called on valid UnitOfWork
instances.
policy.setKeyMethodName("getId")
.
useMapClass
method of DatabaseQuery.
useMapClass
was called on a DirectCollectionMapping
. It is invalid to call the useMapClass
method on a DirectCollectionMapping
. TopLink cannot instantiate Java attributes mapped using a DirectCollectionMapping
with a map. The useMapClass
method is supported for OneToManyMappings
and ManyToManyMappings
. The Java 2 Collection
interface is supported using the useCollectionClass
method.
useCollectionClass
method. Do not call the useMapClass
method on DirectCollectionMapping
.
name
or an error has occurred in setting up the data source.
The connection pool was not configured in your config.xml
file.
The driver is not on the classpath.
The user or password is incorrect.
The database server URL or driver name is not properly specified.
SessionManager
failed to load the class identified by the value associated with properties platform-class
or external-transaction-controller-class
during initialization when it loads the TopLink session common properties from the TopLink global properties file (sessions.xml
for non-EJB applications or toplink-ejb-jar.xml
for EJB applications).
platform-class
and external-transaction-controller-class
properties.
toString
method specified during creation of BMPWrapperPolicy
does not contain a correct findByPrimaryKey
method. A findByPrimaryKey
method must exist that takes the PrimaryKey
class for this bean.
findByPrimaryKey
method exists and is correct.
sessions.xml
file or toplink.properties
file.
sessions.xml
file or toplink.properties
file.
sessions.xml
or toplink.properties
files cannot be loaded.
sessions.xml
should be included in the root of the deployed JAR file. When using a WAR file, the sessions.xml file should be located in the WEB-INF\classes
directory. When using EJB 3.0, TopLink automatically loads the ejb3-toplink-sessions.xml
file.
commit
method on an inactive unit of work that was committed or released.
commit
method on a new unit of work or invoke commitAndResume
method so that the unit of work can be reused. For more information about the commitAndResume
method, see Oracle TopLink API Reference.
null
value for a cache key while attempting to remove an object from the identity map. The most likely cause of this situation is that the object has already been garbage-collected and therefore does not exist within the identity map.
removeFromIdentityMap
method of the Session is intended to allow garbage collection, which has already been done.
sessions.xml
file and that the encryption class specified is available on the classpath. A common reason for this exception is the usage of JDK 1.3 and earlier versions. The TopLink JCE encryption mechanism requires JDK 1.4 and higher (or JDK 1.3 configured with the JCE plug-in) to function properly.
null
. The login used for the project must be a valid login.
HistoricalSession
only works with Oracle 9R2 or later databases, as it uses the Oracle database Flashback feature.
oracle.toplink.history.HistoryPolicy
) works for any database. If a HistoryPolicy
is incorrectly set, TopLink may be defaulting to using flashback instead. An AsOfSCNClause
is implicitly flashback only.
HistoricalSession
from a unit of work, another HistoricalSession
, a ServerSession
, or a ServerSessionBroker
. You may acquire one from a regular session, a ClientSession
, or a ClientSessionBroker
.
HistoricalSession
and UnitOfWork
, and call mergeCloneWithReferences(historicalObject)
method on the UnitOfWork
.
ExclusiveIsolatedClientSession
must not have indirection triggered after the ExclusiveIsolatedClientSession
has been released. Re-read the objects through the current ExclusiveIsolatedClientSession
.
writeChanges
operation has been called on this UnitOfWork
. As the commit process has been started but not yet finalized, the only supported operations now are commit
, commitAndResume
, release
, any non-object level query, or SQLCall
execution. The operation is not allowed at this time.
writeChanges
operation has been called on this UnitOfWork
. Given the possibility that partial changes have been written to the data store but not rolled back (if inside external transaction), the only supported operations now are release, global transaction rollback, any non-object level query or SQLCall
execution.
UnitOfWork
.
writeChanges
method cannot be called on a NestedUnitOfWork
. A nested UnitOfWork
never writes changes directly to the data store, only the parent UnitOfWork
does.
commit
method instead, and then the writeChanges
method on the parent UnitOfWork
.
CMP: Define a class that implements oracle.toplink.ejb.cmp.DeploymentCustomization
, and customize its public String beforeLoginCustomization(Session session)
class to change your server platform. Consult the documentation for defining a customization class in your orion-ejb-jar.xml
file.
Non-CMP/POJO: Define a subclass of oracle.toplink.sessions.SessionEventAdapter
, and override the public void preLogin(SessionEvent event)
method to change your server platform. The session is contained in the event. Consult the documentation for sessions.xml
and using SessionEventAdapter
.
createPlatformDefaultSequence
method.
createPlatformDefaultSequence
method on the platform or explicitly set default sequence by calling setDefaultSequence
on DatasourceLogin
.