ORA-12899: value too large for column, even if value in Exception is smaller

czo02 picture czo02 · Oct 23, 2013 · Viewed 8k times · Source

I'm getting an ORA-12899 Error when updating Entities in the DB via EclipseLink. The Exception reads as follows:

RuntimeException caught: org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.BatchUpdateException: ORA-12899: value too large for column "T_MONITORING"."VERSION" (actual: 295, maximum: 255)

Error Code: 12899 Query: UpdateObjectQuery(MonitoringBE@7e6dc6aeMonitoringBE {id: 17b50dcd-3184-4b47-998a-7c3a93a71695, hostname: HOSTNAME, releaseTimestamp: 2013-10-17 12:04:01.578, javaVersion: 1.6.0_24, softwareVersion: 4.0.30.SP401-RC8, testId: 6e1bc90f_549a_46aa_91f2_e9ff8a96baef, version: PSDZ:4.8.1.0332013 - 20130522-1210;KIS AWL:5.0.0;KIS-WB:[S15A;0;0;32;2;Mon Oct 07 15:03:55 CEST 2013;4556499;3;Ausleitung zu SAb;8;8], lastMrtAnswer: 2013-10-17 12:45:15.471, serverInstance: MyServer, lastModified: 2013-10-17 12:45:24.088})

The column "VERSION" is defined as VARCHAR2(255 CHAR). My problem in this case is that the String in the exception is not longer than 255 Chars. How can that be? Is the Exception's output wrong? The update query is not executed.

The BusinessEntity (MonitoringBE) is manipulated in plaind java using setter-methods. Then a merge is called in the entity manager (javax.persistence.EntityManager):

getEntityManager().merge( entity )

I'm using Oracle 11g Enterprise (11.2.0.2.0) with EclipseLink 2.1.1 from a Java 1.6.0.24 Glassfish Server. The character set in Oracle is AL32UTF8 which should be able to store all types of chars (4 Byte).

Can anyone help?

Answer

Fahad picture Fahad · Oct 23, 2013

as mentioned in error "actual: 295"

Which mean database layer getting 295 character for the column, please make sure that query syntax and double quotes, comma etc in correct place