Project

General

Profile

Bug #9160

trackDatabase() is not called for buffers with openscope 0 resulting in improper cleanup of database counter

Added by Lorian Sandu almost 2 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

History

#1 Updated by Lorian Sandu almost 2 years ago

main.p

def new shared temp-table tt1
    field f1 as int
    field f2 as int.

def new shared buffer buf1 for  tt1.
def new shared buffer buf2 for  tt1.

def var i as int.

do i = 1 to 5:
    run value("test2.p")(i).
end.

and test2.p file :

def shared temp-table tt1
    field f1 as int
    field f2 as int.

def shared buffer buf1 for  tt1.
def shared buffer buf2 for  tt1.

def input param type1 as c.
message type1.

TxWrapper$WorkArea.activeDatabases increases each time a buffer opens its scope but at the end of the execution of the program it doesn't decrease for buffers that have already openScopeCount = 0.

Initial solution was calling it from RecordBuffer.finishedImpl() but this solution showed regressions:

+
+      // Decrement database counter for this buffer before openScopeCount gets to 0 - only for static buffers
+      // dynamic buffers are explicitly deleted, and 'finished' is executed before 'resourceDeleted'
+      if (!dynamic && openScopeCount == 1)
+      {
+         bufferManager.getTxWrapperHelper().trackDatabase(this, false);
+      }

       // Decrement reference count of open scopes for this buffer.
       openScopeCount--;

Also available in: Atom PDF