From: <leg...@at...> - 2003-11-07 14:32:26
|
The following comment has been added to this issue: Author: Joseph Fifield Created: Fri, 7 Nov 2003 8:31 AM Body: Not sure if this helps, but the following code returns the right update count for me using the jTDS driver on SQL Server 2000. SQL Server appears to return multiple update counts when a trigger is fired, and the last one is the update count for the statement you actually executed. ps.executeUpdate(); int updateCount = ps.getUpdateCount(); while (!ps.getMoreResults() && (ps.getUpdateCount() != -1)) { updateCount = ps.getUpdateCount(); } --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-139 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-139 Summary: Relax rowcount to be > instead of equal to account for triggers. Type: Improvement Status: Assigned Priority: Major Project: Hibernate2 Components: core Versions: 2.0 final Assignee: Gavin King Reporter: Don Eddleman Created: Tue, 17 Jun 2003 10:15 AM Updated: Tue, 4 Nov 2003 5:48 PM Environment: All OSs, SQLServer and more than likely any other DB that supports triggers. Description: Within the NonBatchingBatcher class the check for row count to determine success should be relaxed to rowCount >= expected so that any triggers defined on tables affected by the insert/update will not cause a txn to fail just because they fired. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |