users@glassfish.java.net

Re: Toplink - Invalid value for getLong() - 'String' in column 5

From: <glassfish_at_javadesktop.org>
Date: Tue, 13 Mar 2007 06:18:15 PST

The problem here is that TopLink is attempting to optimize the data conversion using the JDBC driver APIs. When TopLink is retrieving the results from the resultset it does not yet know what type of object to use as a template for the conversion.
You can seperate the column into 2 columns of through a session customizer tell Toplink to not optimize the data conversion.
[u]
Persistence.xml entry:[/u]
        <property name="toplink.session.customizer" value="mypackage.DontOptimizeDataConversionCustomizer"/>

[u]Customizer Class :[/u]
package mypackage;
import oracle.toplink.essentials.sessions.Session;

/**
 * PUBLIC:
 * This interface is to allow extra customization on a TopLink Session
 */
public class DontOptimizeDataConversionCustomizer extends SessionCustomizer {
    public void customize(Session session) throws Exception {
        session.getLogin().setShouldOptimizeDataConversion(false);
    }
}
[Message sent by forum member 'gyorke' (gyorke)]

http://forums.java.net/jive/thread.jspa?messageID=207649