IDEMPIERE-3162:infoPanel:postgresql need trx to use cursor based resultset
This commit is contained in:
parent
eb6c1f4347
commit
0d78b00ce2
|
@ -3543,6 +3543,7 @@ public class GridTable extends AbstractTableModel
|
||||||
|
|
||||||
private void openResultSet() {
|
private void openResultSet() {
|
||||||
//postgresql need trx to use cursor based resultset
|
//postgresql need trx to use cursor based resultset
|
||||||
|
//https://jdbc.postgresql.org/documentation/head/query.html#query-with-cursor
|
||||||
String trxName = m_virtual ? Trx.createTrxName("Loader") : null;
|
String trxName = m_virtual ? Trx.createTrxName("Loader") : null;
|
||||||
trx = trxName != null ? Trx.get(trxName, true) : null;
|
trx = trxName != null ? Trx.get(trxName, true) : null;
|
||||||
// open Statement (closed by Loader.close)
|
// open Statement (closed by Loader.close)
|
||||||
|
|
|
@ -840,9 +840,13 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
||||||
isHasNextPage = false;
|
isHasNextPage = false;
|
||||||
if (log.isLoggable(Level.FINER))
|
if (log.isLoggable(Level.FINER))
|
||||||
log.finer(dataSql);
|
log.finer(dataSql);
|
||||||
|
Trx trx = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_pstmt = DB.prepareStatement(dataSql, null);
|
//https://jdbc.postgresql.org/documentation/head/query.html#query-with-cursor
|
||||||
|
String trxName = Trx.createTrxName("InfoPanelLoad:");
|
||||||
|
trx = Trx.get(trxName, true);
|
||||||
|
m_pstmt = DB.prepareStatement(dataSql, trxName);
|
||||||
setParameters (m_pstmt, false); // no count
|
setParameters (m_pstmt, false); // no count
|
||||||
if (log.isLoggable(Level.FINE))
|
if (log.isLoggable(Level.FINE))
|
||||||
log.fine("Start query - " + (System.currentTimeMillis()-startTime) + "ms");
|
log.fine("Start query - " + (System.currentTimeMillis()-startTime) + "ms");
|
||||||
|
@ -889,6 +893,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
DB.close(m_rs, m_pstmt);
|
DB.close(m_rs, m_pstmt);
|
||||||
|
trx.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (end > cacheEnd || end <= 0)
|
if (end > cacheEnd || end <= 0)
|
||||||
|
|
Loading…
Reference in New Issue