Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0021360
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2012-08-15 16:322012-08-29 16:36
ReporterrafademiguelView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in Version3.0MP15
StatusclosedFix in branchpiFixed in SCM revision72e0f315fe57
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0021360: DalConnectionProvider getTransactionConnection() should be equal than ConnectionProviderImpl getTransactionConnection()

DescriptionThe behaviour of DalConnectionProvider getTransactionConnection() should be equal than ConnectionProviderImpl getTransactionConnection().

Right now ConnectionProviderImpl getTransactionConnection() give a NEW connection and DalConnectionProvider getTransactionConnection() give the connection of the session.
Steps To ReproduceI have some code, is a Process Bundle so the connection provider are get: ProcessBundle.getConnection();

There is a moment that I need to call a method from a class that makes some inserts with XSQL, the class is like this:

public OBError setAttributeInstance(ConnectionProvider conProv,.....)
    conn = conProv.getTransactionConnection();
    ......
    conProv.releaseCommitConnection(conn);
    } catch (Exception e) {
    ....
    conProv.releaseRollbackConnection(conn);
    }

Whatever happens here I don't want rise an exception, I want my flow to continue.

What's the matter?

DalConnectionProvider()

If I use new DalConnectionProvider() when they call getTransactionConnection(); it is giving to me this:

     connection = OBDal.getInstance().getConnection(flush);

so if something goes wrong in my method the rollback affects to the things that happen in my method but also the things I have done before, so breaks my flow

ConnectionProviderImpl(properties)

However, if I use the old implementation ConnectionProviderImpl the getTransactionConnection(); is giving to me this

      /**
       * Gets a new connection without trying to obtain the sessions's one
       */
      private Connection getNewConnection(String poolName) throws NoConnectionAvailableException {....}

So its give a real NEW connection, so when I rollback, only rollback the things done in this conn and doesn't break my entire flow
Proposed SolutionModify DalConnectionProvider getTransactionConnection() in order to get a NEW connection.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0037205 closedalostale DB connections leaked executing IssuesTest 

-  Notes
(0051403)
hgbot (developer)
2012-08-20 22:06

Repository: erp/devel/pi
Changeset: 72e0f315fe574302df9166185cdfca891d418a16
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Aug 20 18:26:36 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/72e0f315fe574302df9166185cdfca891d418a16 [^]

Fixes issue 21360: DalConnectionProvider getTransactionConnection() should be equal than ConnectionProviderImpl
Use a statelesssession to create a new connection

---
M src-test/org/openbravo/test/dal/IssuesTest.java
M src/org/openbravo/service/db/DalConnectionProvider.java
---
(0051409)
mtaal (manager)
2012-08-20 22:24

Set closed by
(0051410)
mtaal (manager)
2012-08-20 22:24

.
(0051411)
mtaal (manager)
2012-08-20 22:25

Resolved

- Issue History
Date Modified Username Field Change
2012-08-15 16:32 rafademiguel New Issue
2012-08-15 16:32 rafademiguel Assigned To => mtaal
2012-08-15 16:32 rafademiguel Modules => Core
2012-08-20 22:06 hgbot Checkin
2012-08-20 22:06 hgbot Note Added: 0051403
2012-08-20 22:06 hgbot Status new => resolved
2012-08-20 22:06 hgbot Resolution open => fixed
2012-08-20 22:06 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/72e0f315fe574302df9166185cdfca891d418a16 [^]
2012-08-20 22:24 mtaal Note Added: 0051409
2012-08-20 22:24 mtaal Status resolved => new
2012-08-20 22:24 mtaal Resolution fixed => open
2012-08-20 22:24 mtaal Closed by => marvintm
2012-08-20 22:24 mtaal Status new => scheduled
2012-08-20 22:24 mtaal Note Added: 0051410
2012-08-20 22:24 mtaal fix_in_branch => pi
2012-08-20 22:25 mtaal Note Added: 0051411
2012-08-20 22:25 mtaal Status scheduled => resolved
2012-08-20 22:25 mtaal Fixed in Version => 3.0MP15
2012-08-20 22:25 mtaal Resolution open => fixed
2012-08-29 16:36 marvintm Status resolved => closed
2017-11-10 09:35 caristu Relationship added related to 0037205


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker