Project: 	
  | View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | ||||||||
| 0035645 | ||||||||
| Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
| defect | [Retail Modules] StoreServer | major | have not tried | 2017-03-29 19:16 | 2017-03-30 16:32 | |||
| Reporter | AugustoMauch | View Status | public | |||||
| Assigned To | AugustoMauch | |||||||
| Priority | normal | Resolution | fixed | Fixed in Version | RR17Q2 | |||
| Status | closed | Fix in branch | Fixed in SCM revision | 3f81060a571b | ||||
| Projection | none | ETA | none | Target Version | ||||
| OS | Any | Database | Any | Java version | ||||
| OS Version | Database version | Ant version | ||||||
| Product Version | SCM revision | |||||||
| Merge Request Status | ||||||||
| Review Assigned To | mtaal | |||||||
| OBNetwork customer | No | |||||||
| Support ticket | ||||||||
| Regression level | ||||||||
| Regression date | ||||||||
| Regression introduced in release | ||||||||
| Regression introduced by commit | ||||||||
| Triggers an Emergency Pack | No | |||||||
| Summary | 0035645: Prevent invoking a commitAndClose inside an event handler | |||||||
| Description | The OrderEventHandler class [1] invokes the MobileServerProvider.getInstance().getMobileServersForOrganization(organizationId) method to fetch the list of servers with access to that organization. The problem is that the getMobileServersForOrganization ends up invoking commitAndClose [2] if its cache has not been initialized.  Error log: 69315 [http-bio-8070-exec-9] WARN org.openbravo.dal.core.OBInterceptor - The object GCNV_GiftCardInst(18EFFD272CF8464790497CD1456CA6B7) (searchKey: Test, type: BasedOnProductGiftCard) is detected as not new (is its id != null?) but it does not have a current state in the database. This can happen when the id is set but not setNewObject(true); has been called. 69321 [http-bio-8070-exec-9] 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) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216) at org.openbravo.dal.service.OBDal.flush(OBDal.java:260) at org.openbravo.dal.core.SessionHandler.flushRemainingChanges(SessionHandler.java:680) at org.openbravo.dal.core.SessionHandler.commitAndClose(SessionHandler.java:592) at org.openbravo.dal.service.OBDal.commitAndClose(OBDal.java:223) at org.openbravo.replication.symmetricds.util.MobileServerProvider.initializeDataCachedByOrganization(MobileServerProvider.java:231) [1] https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/file/f982c1ca4b6c/src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrderEventHandler.java#l152 [^] [2]  | |||||||
| Steps To Reproduce | In a central server without SymmetricDS installed, create a giftcard instance. If the MobileServerProvider cache is not initialized, the error will be shown and the giftcard instance will not be created. | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
		  Relationships		[ Relation Graph ] 
		[ Dependency Graph ] 
			 | 
||||||||
  | 
||||||||
  		Notes	 | 
|
| 
				(0095676) hgbot (developer) 2017-03-29 19:20  | 
	
		Repository: erp/pmods/org.openbravo.replication.symmetricds Changeset: 36a93cba93a55b2c611fa6a5af622e5112a89f44 Author: Augusto Mauch <augusto.mauch <at> openbravo.com> Date: Wed Mar 29 19:18:56 2017 +0200 URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/36a93cba93a55b2c611fa6a5af622e5112a89f44 [^] Fixes issue 35645: Allow to initialize cache without transaction commit The two caches of MobileServerProvider now can be initialized with or without a transaction commit. By default they will be initialized committing the transaction, to preserve the current behaviour. --- M src/org/openbravo/replication/symmetricds/util/MobileServerProvider.java ---  | 
| 
				(0095677) hgbot (developer) 2017-03-29 19:23  | 
	
		Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization Changeset: 3f81060a571b5957586ce77702b27075277b325e Author: Augusto Mauch <augusto.mauch <at> openbravo.com> Date: Wed Mar 29 19:21:13 2017 +0200 URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/3f81060a571b5957586ce77702b27075277b325e [^] Fixes issue 35645: Prevents invoking a commitAndClose inside an eventhandler --- M src/org/openbravo/retail/storeserver/synchronization/eventhandler/OrderEventHandler.java ---  | 
| 
				(0095724) mtaal (viewer) 2017-03-30 16:32  | 
	Reviewed | 
  Issue History	 | 
|||
| Date Modified | Username | Field | Change | 
| 2017-03-29 19:16 | AugustoMauch | New Issue | |
| 2017-03-29 19:16 | AugustoMauch | Assigned To | => AugustoMauch | 
| 2017-03-29 19:16 | AugustoMauch | OBNetwork customer | => No | 
| 2017-03-29 19:16 | AugustoMauch | Triggers an Emergency Pack | => No | 
| 2017-03-29 19:20 | hgbot | Checkin | |
| 2017-03-29 19:20 | hgbot | Note Added: 0095676 | |
| 2017-03-29 19:20 | hgbot | Status | new => resolved | 
| 2017-03-29 19:20 | hgbot | Resolution | open => fixed | 
| 2017-03-29 19:20 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/36a93cba93a55b2c611fa6a5af622e5112a89f44 [^] | 
| 2017-03-29 19:23 | hgbot | Checkin | |
| 2017-03-29 19:23 | hgbot | Note Added: 0095677 | |
| 2017-03-29 19:23 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/36a93cba93a55b2c611fa6a5af622e5112a89f44 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/3f81060a571b5957586ce77702b27075277b325e [^] | 
| 2017-03-29 19:23 | AugustoMauch | Review Assigned To | => mtaal | 
| 2017-03-29 19:25 | AugustoMauch | Relationship added | related to 0034465 | 
| 2017-03-30 16:32 | mtaal | Note Added: 0095724 | |
| 2017-03-30 16:32 | mtaal | Status | resolved => closed | 
| 2017-03-30 16:32 | mtaal | Fixed in Version | => RR17Q2 | 
| Copyright © 2000 - 2009 MantisBT Group |