Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-2792

CLONE -HHH-2388 : Insert w/ identity column fails on Sybase but no exception occurs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: EAP 5.0.0.CR1, EAP 5.0.0.BETA, EAP 5.0.0.CR2, EAP 5.0.0.CR3, EAP 5.0.0.CR4 (FCS and BETA2), EAP 5.0.0.CR5, EAP 5.0.0, EAP 5.0.1.CR1, EAP_EWP 5.1.0
    • Fix Version/s: TBD
    • Component/s: Hibernate
    • Labels:
      None
    • Affects:
      Release Notes
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      To make it working, use one of the turn around solutions:

      • Use jconn3.jar with DYNAMIC_PREPARE=true option (in Hibenate
        configuration file)
        Example:
        <property name="connection.url">jdbc:sybase:Tds:aurum:1503/masterDb?
        DYNAMIC_PREPARE=true</property>

      OR

      • Use jconn4.jar

      Reason:
      ASE does not throw exception when sql is Parameterized Sql, jconn3.jar uses
      Parameterized Sql for insertion hence no exception is thrown
      By using Dynamic Prepare as 'true' will cause ASE to throw exception.

      Where as jconn4.jar we are using Dynamic Prepared Statement hence exception
      is thrown.

      Note:
      While using jconn3.jar use
      <property name="connection.driver_class">com.sybase.jdbc3.jdbc.SybDriver</
      property>

      And for jconn4.jar use
      <property name="connection.driver_class">com.sybase.jdbc4.jdbc.SybDriver</
      property>

      Show
      To make it working, use one of the turn around solutions: Use jconn3.jar with DYNAMIC_PREPARE=true option (in Hibenate configuration file) Example: <property name="connection.url">jdbc:sybase:Tds:aurum:1503/masterDb? DYNAMIC_PREPARE=true</property> OR Use jconn4.jar Reason: ASE does not throw exception when sql is Parameterized Sql, jconn3.jar uses Parameterized Sql for insertion hence no exception is thrown By using Dynamic Prepare as 'true' will cause ASE to throw exception. Where as jconn4.jar we are using Dynamic Prepared Statement hence exception is thrown. Note: While using jconn3.jar use <property name="connection.driver_class">com.sybase.jdbc3.jdbc.SybDriver</ property> And for jconn4.jar use <property name="connection.driver_class">com.sybase.jdbc4.jdbc.SybDriver</ property>
    • Release Notes Docs Status:
      Not Required

      Description

      http://opensource.atlassian.com/projects/hibernate/browse/HHH-2388

      A workaround is that the application validate entity properties to ensure they do not overflow what is defined for the underlying column.

      Because Sybase does not throw an exception, it does indicate an update count of 0. Hibernate does not check the update count so it does not detect that the insert failed.

      According to HHH-2388, Hibernate sets the ID to 0. HHH-2830 (a duplicate issue) says that the ID in the (still) transient entity is set to the previous ID that was generated.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  stliu Strong Liu
                  Reporter:
                  gbadner Gail Badner
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: