openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Bauer (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (OPENJPA-750) OptimisticLockException is thrown when numeric truncation occurs on Sybase
Date Thu, 23 Oct 2008 14:52:44 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jeremy Bauer resolved OPENJPA-750.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0

Committed in revision 707270.

Resolved issue by adding a new option, IgnoreNumericTruncation to the Sybase dictionary. 
In addition, code was added to the batching and standard prepared statement managers to log
any SQL warnings that result from statement execution.  That will help make issues such as
this simpler to diagnose for those JDBC drivers that surface individual or batch operation
failures as a warning.

> OptimisticLockException is thrown when numeric truncation occurs on Sybase
> --------------------------------------------------------------------------
>
>                 Key: OPENJPA-750
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-750
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.3.0
>         Environment: Sybase 15, jconn3.jar
>            Reporter: Jeremy Bauer
>             Fix For: 1.3.0
>
>
> OpenJPA throws an OptimisicLockException after an insert is issued to Sybase and there
is no SQLException and the update count does not match the expected value.  The root cause
is that the insert is trying to insert a numeric value which is larger than the numeric field.
 Sybase issues a SQLWarning  (preparedStatement.getWarnings()) and the insert fails.  An OptimisticLockException
is thrown with misleading statement text.
> I recommend we:
> 1) Add a config property to disable numeric truncation, if possible.
> 2) Check for SQLWarning's after an ps exec fails and minimally log them.  Or throw them
as a more appropriate exception?
> This issue is very similar to OPENJPA-745, except 745 deals with character truncation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message