Hi everybody!

When running one of our application on our staging server I get Database 
Exceptions like this:

Jul 14 16:57:23 PortalWonderTest[2100] DEBUG NSLog  -  === Begin Internal 
Transaction
Jul 14 16:57:23 PortalWonderTest[2100] DEBUG NSLog  -  evaluateExpression: 
<com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "UPDATE TERMIN SET 
mailToInterviewer = ? WHERE TERMINID = ?" withBindings: 1:2011-07-14 
16:57:23(mailToInterviewer), 2:14478(terminid)>
Jul 14 16:57:23 PortalWonderTest[2100] INFO  er.transaction.adaptor.Exceptions  
- Database Exception occured: 
com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression failed: 
<com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "UPDATE TERMIN SET 
mailToInterviewer = ? WHERE TERMINID = ?" withBindings: 1:2011-07-14 
16:57:23(mailToInterviewer), 2:14478(terminid)>:
   Next exception:SQL Warning:22001 -- error code: 0 -- msg: Data truncation: 
Data truncated for column 'mailToInterviewer' at row 1
Jul 14 16:57:23 PortalWonderTest[2100] DEBUG NSLog  -  === Rollback Internal 
Transaction
Jul 14 16:57:23 PortalWonderTest[2100] ERROR 
er.extensions.appserver.ERXApplication  - Exception caught: 
java.lang.reflect.InvocationTargetException

full log here:

Attachment: Data truncation.log
Description: Binary data



The strange thing about this is that when I am trying to reproduce this locally 
I don't run into an Exception, the same SQL is generated and processed nicely. 
Also, if I run the SQL:

UPDATE TERMIN SET mailToInterviewer = '2011-07-14 16:57:23' WHERE TERMINID = 
'14478'

in Sequel Pro I get the expected result without any problems.


The column is of type DATE. 


Previously, the attribute was defined like the following in the EOModel:

       {
            allowsNull = Y; 
            columnName = mailToInterviewer; 
            externalType = DATE; 
            name = mailToInterviewer; 
            prototypeName = creationDate; 
        }, 

where creationDate was erroneously chosen as prototype:

        {
            allowsNull = Y; 
            columnName = ERSTELLTAM; 
            externalType = DATETIME; 
            name = creationDate; 
            valueClassName = NSCalendarDate; 
        }, 

So I thought that the definition of creationDate as DATETIME conflicted with 
the column type DATE (and causes the truncation of "2011-07-14 16:57:23")

So I changed this to:

        {
            allowsNull = Y; 
            className = "com.webobjects.foundation.NSTimestamp"; 
            columnName = mailToInterviewer; 
            externalType = DATE; 
            name = mailToInterviewer; 
        }, 

but it still didn't work. Changing it to

        {
            allowsNull = Y; 
            className = NSCalendarDate; 
            columnName = mailToInterviewer; 
            externalType = DATE; 
            name = mailToInterviewer; 
        }, 

like all the other date attributes in the model doesn't work either. As I said 
only on the staging and live machine. Everything of the above DID WORK on my 
development machine.



Has somebody any clues?


cheers,

        Lars

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to