Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028852Openbravo ERPA. Platformpublic2015-02-03 17:052015-02-09 08:48
jecharri 
AugustoMauch 
immediateminoralways
closedfixed 
5
 
3.0PR15Q2 
alostale
Google Chrome
Core
No
0028852: When you add or remove a treenode you will receive ugly error in the log and also strange behavior
When you add or remove a treenode you will receive ugly error in the log and also strange behavior.
-Define a table to include a tree. It must use the ADTree structure, and set the Handle Nodes Manually flag to false (this way the ADTreeNodes will be created automatically).
-Add a record in that table
-You will receive the following error:
867946fe 921928 [http-2080-1] ERROR org.hibernate.jdbc.AbstractBatcher - Exception executing batch:
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
    at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:85)
    at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:70)
    at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:90)
    at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
-remove the flush commands because it seems that inside an eventhandler is creating problems
No tags attached.
caused by feature request 00259063.0PR14Q2 closed AugustoMauch Tree Extension Project 
Issue History
2015-02-03 17:05jecharriNew Issue
2015-02-03 17:05jecharriAssigned To => AugustoMauch
2015-02-03 17:05jecharriWeb browser => Google Chrome
2015-02-03 17:05jecharriModules => Core
2015-02-03 17:05jecharriResolution time => 1423436400
2015-02-03 17:05jecharriRegression level => Production - Confirmed Stable
2015-02-03 17:05jecharriRegression date => 2014-02-27
2015-02-03 17:05jecharriRegression introduced in release => 3.0PR14Q3
2015-02-03 17:05jecharriRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/5cec8a63b6c8 [^]
2015-02-03 17:05jecharriTriggers an Emergency Pack => No
2015-02-04 12:13AugustoMauchWeb browserGoogle Chrome => Google Chrome
2015-02-04 12:13AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7611#r7611
2015-02-04 12:22AugustoMauchWeb browserGoogle Chrome => Google Chrome
2015-02-04 12:22AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7612#r7612
2015-02-04 18:00AugustoMauchRelationship addedcaused by 0025906
2015-02-04 18:00AugustoMauchIssue Monitored: alostale
2015-02-04 18:00AugustoMauchReview Assigned To => alostale
2015-02-04 18:00AugustoMauchWeb browserGoogle Chrome => Google Chrome
2015-02-04 18:02hgbotCheckin
2015-02-04 18:02hgbotNote Added: 0074092
2015-02-04 18:02hgbotStatusnew => resolved
2015-02-04 18:02hgbotResolutionopen => fixed
2015-02-04 18:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/963be1616dd53624ed59eb7b4da876b1fd301f7d [^]
2015-02-04 18:33AugustoMauchRegression levelProduction - Confirmed Stable =>
2015-02-04 18:33AugustoMauchRegression date2014-02-27 =>
2015-02-04 18:33AugustoMauchRegression introduced in release3.0PR14Q3 =>
2015-02-04 18:34AugustoMauchRegression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/5cec8a63b6c8 [^] =>
2015-02-05 15:42hudsonbotCheckin
2015-02-05 15:42hudsonbotNote Added: 0074231
2015-02-09 08:48alostaleNote Added: 0074264
2015-02-09 08:48alostaleStatusresolved => closed
2015-02-09 08:48alostaleFixed in Version => 3.0PR15Q2

Notes
(0074092)
hgbot   
2015-02-04 18:02   
Repository: erp/devel/pi
Changeset: 963be1616dd53624ed59eb7b4da876b1fd301f7d
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Feb 04 17:56:52 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/963be1616dd53624ed59eb7b4da876b1fd301f7d [^]

Fixes bug 28852: Adding automatically a tree node does not trigger error in log

In this changeset [1], a flush operation was added after the add, update and delete operations on ADTreeNode entities. This was done because it was needed for the update operation, and was also included fo
r the add and delete operations because it was thought that it would be needed too. The problem was that not only it was not needed, but it also shows an error in the log (the ADTreeNodes are succesfully a
dded/removed, though).

In this case, when an ADTreeNode is updated (i.e. when is moved under another node), the flush done to actually commit the changes must be done just after modifying it to ensure it is done while the contex
t is in admin mode. Otherwise, the next flush that is done might be outside an admin mode block, and the operation will fail if the user had no access to the ADTtreeNode entity. This does not happen with t
he add and remove operation. As long as the OBDal.getInstance().add and OBDal.getInstance().remove methods are invoked in an admin mode block, the operation will work regardless of when the OBDal.getInstan
ce().flush method is invoked.

[1] https://code.openbravo.com/erp/devel/pi/rev/5cec8a63b6c8 [^]

---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java
---
(0074231)
hudsonbot   
2015-02-05 15:42   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/f60af6e6baca [^]
Maturity status: Test
(0074264)
alostale   
2015-02-09 08:48   
code reviewed and tested