[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3679) Sybase conversion of Java byte to tinyint fails with 8-bit values causing unit test failures

Gail Badner (JIRA) noreply at atlassian.com
Fri Dec 26 19:24:38 EST 2008


Sybase conversion of Java byte to tinyint fails with 8-bit values causing unit test failures
--------------------------------------------------------------------------------------------

                 Key: HHH-3679
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3679
             Project: Hibernate Core
          Issue Type: Bug
         Environment: Sybase
            Reporter: Gail Badner
            Assignee: Gail Badner
             Fix For: 3.2.x, 3.3.x, 3.4


If an 8-bit byte value is inserted into a Sybase TINYINT column, GenericJDBCException is thrown because of an arithmetic overflow during implicit conversion of a SMALLINT value to a TINYINT field.

This is happening for MixedTest.testMixedInheritance() and InterfaceProxyTest.testInterfaceProxies().

The full stacktrace is:

could not insert: [org.hibernate.test.interfaceproxy.SecureDocumentImpl]" type="org.hibernate.exception.
GenericJDBCException">org.hibernate.exception.GenericJDBCException: could not insert: [org.hibernate.test.interfaceproxy.Sec
ureDocumentImpl]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2267)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2640)
        at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
        at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
        at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventL
istener.java:187)
        at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:
172)
        at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
        at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
        at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
        at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
        at org.hibernate.test.interfaceproxy.InterfaceProxyTest.testInterfaceProxies(InterfaceProxyTest.java:52)
        at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:102)
        at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34)
        at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100)
        at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)
Caused by: com.sybase.jdbc3.jdbc.SybSQLException: Arithmetic overflow during implicit conversion of SMALLINT value '-10
4' to a TINYINT field .

        at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
        at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeUpdate(Unknown Source)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2250)
        ... 34 more




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list