Probaste con COMMIT?
Commit Command
Scope
Objects: Procedures, Web Panels, Work Panels
Languages: .NET, C/SQL, Cobol, Java, RPG, Visual Basic, Visual Fox Pro
Interfaces: Win
Purpose
Forces a Commit command when included in a program.
Syntax
Commit
Description
GeneXus activates the Commitment Control for all Procedures and Transactions, unless the Commitment property has been disabled, and only generates a Commit at the end of the Procedure or Transaction program execution.
Locks are released when the Commit sentence is encountered.
When an object updates too many records, the lock limit (in the iSeries, for instance, is approximately 4.000 or 32.000 depending on OS version) may be exceeded. So, it is necessary to use more than one Commit command in the object, because it avoids reaching or exceeding the limit.
The Commit command can be specified anywhere in the program source of procedures. Doing this will force GeneXus to generate a Commit command. When a Commit command is included within a For Each sentence the Commit is executed just before the Endfor always (regardless of where it was included within the For Each sentence).
Example
Given the table:
Invoices:
InvNo*
InvDate
CliNo
InvAmount
Let us assume that a Commit will be performed, each time 10 invoices are deleted. This could be done as follows:
&i = 0
For each InvNo // Invoice
where InvDate >= &firstD
where InvDate <= &lastD
&i = &i + 1
delete
If &i = 10
commit
&i = 0
Endif
Endfor