When debugging Castor mapping file, the SQL statements issued by Castor
can be incorrect. As everything is hidden in the internals of the
library, it can get tricky to determine what is wrong.
In such cases, having the SQL statement in the log just before the
exception can really help...
Here is the patch to SQLEngine to get those logs :
src/main/org/exolab/castor/jdo/engine/SQLEngine.java
627a628,629
> if ( _logInterceptor != null )
> _logInterceptor.storeStatement( "Error creating " + _type + ",
SQL : " + _sqlCreate );
760a763
> String storeStatement = null;
770c773,774
< stmt = ( (Connection) conn ).prepareStatement(
getStoreStatement(
original ) );
---
> storeStatement = getStoreStatement( original );
> stmt = ( (Connection) conn ).prepareStatement( storeStatement );
876a881,882
> if ( _logInterceptor != null )
> _logInterceptor.storeStatement( "Error updating " + _type + ",
SQL : " + storeStatement );
920a927,928
> if ( _logInterceptor != null )
> _logInterceptor.storeStatement( "Error deleting " + _type + ",
SQL : " + _sqlRemove );
1080a1089,1090
> if ( _logInterceptor != null )
> _logInterceptor.storeStatement( "Error loading " + _type + ",
SQL : " + (( accessMode == AccessMode.DbLocked ) ? _sqlLoadLock :
_sqlLoad) );
--
Mickael Guessant
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev