Weird, the DB2 
infocenter<http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.admin.doc/doc/r0001029.htm>seems
to indicate that 30 is the max length for an unqualified column name.
Maybe I misunderstand what they mean by unqualified though :-).

IIRC you can change the value by setting this property in persistence.xml :

<property name="openjpa.jdbc.DBDictionary"
value="db2(MaxColumnNameLength=40)"/>

It's weird that it worked with OpenJPA 1.2.3, though. You should see an INFO
message like this one:
INFO   [main] openjpa.jdbc.JDBC - Using dictionary class  ${class name here}


Do you see a different class name for 1.2.3, and 1.3?

-mike

On Fri, Sep 10, 2010 at 10:58 AM, jeffpeschka <
[email protected]> wrote:

>
> I'm trying to upgrade from OpenJpa 1.2.3 to 1.3.  I am using DB2 9.7.2 with
> the current drivers.  I copied openjpa-all-1.3.0-SNAPSHOT.jar into my
> classpatch, started my server and the code to perform a login code is
> throwing the DB2 206 error.  This error means "Column does not exist in any
> table in the SELECT".
>
> The column CRYSTAL_SERVER_BASE_REPORT_LOCATION is being truncated to 30
> characters as seen in the error message,
> t0.CRYSTAL_SERVER_BASE_REPORT_LOC''.  The defaults for max table and column
> size are much higher than 30 characters, so this appears to be an OpenJpa
> errors, since all i did was upgrade the jar files.  Are there any fixes for
> this, or are there any jdbc DB2 parameters I can specify in the
> persistence.xml file to explicity set the table/column max size?
>
> The stack traces is below:
>
> ]] Root cause of ServletException.
> org.apache.openjpa.lib.jdbc.ReportingSQLException: DB2 SQL Error:
> SQLCODE=-206, SQLSTATE=42703, SQLERRMC=T0.CRYSTAL_SERVER_BASE_REPORT_LOC,
> DRIVER=3.50.152 {prepstmnt 19654 SELECT t0.ENVIRONMENT_SETTINGS_ID,
> t0.BASE_EXPORT_DIRECTORY, t0.BASE_IMPORT_DIRECTORY, t0.BASE_WEBSERVER_URL,
> t0.BATCH_HISTORY_KEEP_DAYS, t0.CRYSTAL_SERVER_BASE_REPORT_LOC,
> t0.CRYSTAL_SERVER_PROVIDER_PASS, t0.CRYSTAL_SERVER_PROVIDER_URL,
> t0.CRYSTAL_SERVER_PROVIDER_USER, t0.ENVIRONMENT_CD, t0.LAST_CSR_DPS_NUMBER,
> t0.LAST_PCLA_DPS_NUMBER, t0.LAST_TRIP_NUMBER, t0.SYSTEM_DT,
> t0.SYSTEM_OPEN_FLAG FROM NRPDATA.SYS_ENVIRONMENT_SETTINGS t0 WHERE
> (t0.ENVIRONMENT_CD = ?)  optimize for 1 row [params=?]} [code=-206,
> state=42703]    at
>
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:216)
>        at
>
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:204)
>        at
>
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:58)
>        at
>
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1010)
>        at
>
> org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:262)
>        Truncated. see log file for complete stacktrace
> >
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/OpenJpa-1-3-is-truncating-the-column-name-to-30-characters-tp5518816p5518816.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Reply via email to