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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0033434
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] A. Platformminorhave not tried2012-12-13 11:072016-07-06 09:26
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q2.1
StatusclosedFix in branchFixed in SCM revision9ec9da16c06a
ProjectionnoneETAnoneTarget Version3.0PR16Q2.1
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0033434: SqlC does execute all queries at compile time, which is not required.

DescriptionSqlC does execute all select queries at compile time when it is processing xsql files.
Technically that is needed to get the number, names & data-types of the columns in the result as that info is used to generate the fields and data-reading code in the to be generated java file.

However the jdbc spec does have a optional method to get that same information for a query without executing it.

Postgresql does implement that optional method.
Oracle jdbc driver does implement that method only starting with Oracle 11R2
Quoting: https://docs.oracle.com/cd/E18283_01/java.112/e16548/whatsnew.htm#CJACGJHA [^]

""
Starting from Oracle Database 11g Release 2 (11.2), JDBC drivers support obtaining the metadata of a SELECT statement without executing the PreparedStatement. This feature works even with the earlier database releases. For more information, please refer to "Interface oracle.jdbc.OraclePreparedStatement".
""

So it should be fine to just have the updated jdbc driver even when the database behind is not yet 11R2 (Important as System Requirements only have 11 as min version, we do not require R2)


A prototype patch exist which does use this improvement transparently on postgresl and will remove all execution times for those queries on that db.

Steps To Reproduce-
Proposed SolutionReview & apply proposed patch to get this compile time improvement on the database where it is possible.
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks feature request 0022559 closedshuehner SqlC does execute all queries at compile time, which is not required. 

-  Notes
(0088226)
Orekaria (administrator)
2016-07-06 09:24

Attached proposed patch
(0088228)
hgbot (developer)
2016-07-06 09:25

Repository: erp/backports/3.0PR16Q2.1
Changeset: 9ec9da16c06a04e01ae9d8d345835f3cbf340855
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Thu Jun 16 10:04:13 2016 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR16Q2.1/rev/9ec9da16c06a04e01ae9d8d345835f3cbf340855 [^]

fixed issue 33434: SqlC does execute all queries at compile time

  SqlC does execute all select queries at compile time when it is processing
  xsql files.

  Technically that is needed to get the number, names & data-types of the columns
  in the result as that info is used to generate the fields and data-reading code
  in the to be generated java file.

  However the jdbc spec does have a optional method to get that same information
  for a query without executing it.

  As this method is supported in current jdbc drivers for both Oracle and PostgreSQL,
  now it is used instead of executing the whole queries.

---
M src-core/src/org/openbravo/data/Sqlc.java
---
(0088229)
alostale (developer)
2016-07-06 09:26

code reviewd + tested both in Oracle and PG

- Issue History
Date Modified Username Field Change
2016-07-05 17:28 Orekaria Type feature request => backport
2016-07-05 17:28 Orekaria Target Version => 3.0PR16Q2.1
2016-07-06 09:05 Orekaria Assigned To shuehner => alostale
2016-07-06 09:09 alostale Tag Attached: Performance
2016-07-06 09:24 Orekaria File Added: FixesIssue22559.patch
2016-07-06 09:24 Orekaria Note Added: 0088226
2016-07-06 09:25 hgbot Checkin
2016-07-06 09:25 hgbot Note Added: 0088228
2016-07-06 09:25 hgbot Status scheduled => resolved
2016-07-06 09:25 hgbot Resolution open => fixed
2016-07-06 09:25 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/21698df6e4fe6e0272f997ba99be1c38bc966ee7 [^] => http://code.openbravo.com/erp/backports/3.0PR16Q2.1/rev/9ec9da16c06a04e01ae9d8d345835f3cbf340855 [^]
2016-07-06 09:26 alostale Assigned To alostale => shuehner
2016-07-06 09:26 alostale Note Added: 0088229
2016-07-06 09:26 alostale Status resolved => closed
2016-07-06 09:26 alostale Fixed in Version => 3.0PR16Q2.1
2016-07-06 15:35 Orekaria File Deleted: FixesIssue22559.patch


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker