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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037677
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2018-01-19 10:072018-02-22 18:18
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0PR18Q2
StatusclosedFix in branchFixed in SCM revisiona2cba155ca8f
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037677: No need to check if ad_context_info table exists before creating it

DescriptionThe SessionInfo.initDB method creates the ad_context_info temporary table in postgres [1]. Before creating it, it consults the catalog to check if the table has already been created.

This method used to be called each time a connection was borrowed from the pool, but this behaviour changed in this issue [2], now it is invoked only when a physical connection is created in the database. This makes unnecessary to check if the temporary table has been created.

In a high concurrency environment, the query to check if the table exists took longer than 40 seconds, in a peak where lots of connections were created in a short time span.

[1] https://code.openbravo.com/erp/devel/pi/file/tip/src-core/src/org/openbravo/database/SessionInfo.java#l123 [^]
[2] https://issues.openbravo.com/view.php?id=33441 [^]
Steps To Reproduce- Write log before this line [1], printing the result of the query. It will always return 0, making the query unnecessary.

[1] https://code.openbravo.com/erp/devel/pi/file/tip/src-core/src/org/openbravo/database/SessionInfo.java#l128 [^]
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00334413.0PR16Q4 closedNaroaIriarte query to check if ad_context_info exists executed once per request 
related to feature request 0037681 closedAugustoMauch No need to create the ad_context_info table if audit trail is not active, remove Update Audit Trail Infrastructure. 

-  Notes
(0102116)
hgbot (developer)
2018-02-01 13:13

Repository: erp/devel/pi
Changeset: a2cba155ca8ff6c03009eead9a94a21e7c78823a
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Jan 19 11:58:05 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a2cba155ca8ff6c03009eead9a94a21e7c78823a [^]

Fixes issue 37677: Dont check if ad_context_info table exists before creating it

Now, if the pool is used, the query to check if the ad_context_info table already exists will not be done. This check can be skipped because
if the pool is used, the initDB method will only be called when a new physical connection is created, and in that case the temporary table is
garanteed not to exist.

This pool instance check is needed to keep supporting using pools other than org.openbravo.apachejdbcconnectionpool.JdbcExternalConnectionPool (or none at al),
but in those cases the query to check if the ad_context_info table exists will still be performed.

---
M src-core/src/org/openbravo/database/SessionInfo.java
---
(0102145)
caristu (developer)
2018-02-02 10:08

Code reviewed.
(0102705)
hudsonbot (developer)
2018-02-22 18:18

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/980a6ad5bbf5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2018-01-19 10:07 AugustoMauch New Issue
2018-01-19 10:07 AugustoMauch Assigned To => AugustoMauch
2018-01-19 10:07 AugustoMauch Modules => Core
2018-01-19 10:07 AugustoMauch Triggers an Emergency Pack => No
2018-01-19 10:16 AugustoMauch Relationship added related to 0033441
2018-01-19 10:17 AugustoMauch Steps to Reproduce Updated View Revisions
2018-01-19 10:28 AugustoMauch Relationship added related to 0037681
2018-01-29 10:32 alostale Tag Attached: Performance
2018-02-01 13:13 hgbot Checkin
2018-02-01 13:13 hgbot Note Added: 0102116
2018-02-01 13:13 hgbot Status new => resolved
2018-02-01 13:13 hgbot Resolution open => fixed
2018-02-01 13:13 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a2cba155ca8ff6c03009eead9a94a21e7c78823a [^]
2018-02-01 13:14 AugustoMauch Review Assigned To => caristu
2018-02-02 10:08 caristu Note Added: 0102145
2018-02-02 10:08 caristu Status resolved => closed
2018-02-02 10:08 caristu Fixed in Version => 3.0PR18Q2
2018-02-22 18:18 hudsonbot Checkin
2018-02-22 18:18 hudsonbot Note Added: 0102705


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker