Bug #1913
default locking in a BROWSE widget
0%
History
#1 Updated by Ovidiu Maxiniuc over 11 years ago
It appears that I have uncovered a bug in how we deal with default locking in a BROWSE widgets.
In order to test CURRENT-CHANGED I tried a complicated test procedure that should test the behavior of the function in a single session - multiple buffer case. After I executed a FIND I, created a BROWSE widget that let the user edit data, then check if record is changed after calling FIND again.
here is the code:
DEFINE QUERY q1 FOR Customer SCROLLING. DEFINE BROWSE b1 QUERY q1 DISPLAY Name Balance Address WIDTH 18 ENABLE Name Balance WITH 10 DOWN SEPARATORS. DEFINE BUTTON btn-Exit LABEL "Exit". DEFINE FRAME f1 b1 SKIP btn-Exit WITH SIDE-LABELS USE-TEXT CENTERED ROW 2 TITLE "Current-changed with 2 buffers". FIND FIRST Customer NO-LOCK. DEFINE VARIABLE c-before AS CHARACTER NO-UNDO FORMAT "x(64)". c-before = Customer.Name + " " + STRING(Customer.Balance) + " " + Customer.Address. OPEN QUERY q1 FOR EACH Customer NO-LOCK. ENABLE ALL WITH FRAME f1. WAIT-FOR CHOOSE OF btn-Exit. CLOSE QUERY q1. FIND FIRST Customer NO-LOCK. DEFINE VARIABLE c-after AS CHARACTER NO-UNDO FORMAT "x(64)". c-after = Customer.Name + " " + STRING(Customer.Balance) + " " + Customer.Address. DISPLAY IF CURRENT-CHANGED Customer THEN "Changed!" ELSE "Unchanged" LABEL "Ch Check" WITH SIDE-LABELS. DISPLAY SKIP c-before SKIP c-after.
On the 4GL test machine it works fine, however, after the same procedure is converted in P2J and executed, the user cannot move from one field to another inside the BROWSE and he receives the following error messages:
** Customer record has NO-LOCK status, update to field not allowed. (396) ** Unable to update customer Field. (142)
The server console displays the following exceptions:
com.goldencode.p2j.NumberedException: Unable to update customer Field at com.goldencode.p2j.util.ErrorManager.recordOrThrowError(ErrorManager.java:606) at com.goldencode.p2j.persist.RecordBuffer$Handler.invoke(RecordBuffer.java:7339) at com.goldencode.p2j.persist.$Proxy1.setName(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.goldencode.p2j.persist.FieldReference.set(FieldReference.java:540) at com.goldencode.p2j.ui.Element.set(Element.java:333) at com.goldencode.p2j.ui.BrowseColumnWidget.setValue(BrowseColumnWidget.java:261) at com.goldencode.p2j.ui.BrowseWidget.updateRow(BrowseWidget.java:1085) at com.goldencode.p2j.ui.LogicalTerminal.updateRow(LogicalTerminal.java:6735) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76) at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675) at com.goldencode.p2j.net.Conversation.block(Conversation.java:316) at com.goldencode.p2j.net.Conversation.waitMessage(Conversation.java:254) at com.goldencode.p2j.net.Queue.transactImpl(Queue.java:1107) at com.goldencode.p2j.net.Queue.transact(Queue.java:575) at com.goldencode.p2j.net.BaseSession.transact(BaseSession.java:178) at com.goldencode.p2j.net.HighLevelObject.transact(HighLevelObject.java:163) at com.goldencode.p2j.net.RemoteObject$RemoteAccess.invokeCore(RemoteObject.java:1406) at com.goldencode.p2j.net.InvocationStub.invoke(InvocationStub.java:97) at $Proxy0.waitFor(Unknown Source) at com.goldencode.p2j.ui.LogicalTerminal.waitFor(LogicalTerminal.java:3671) at com.goldencode.p2j.ui.LogicalTerminal.waitFor(LogicalTerminal.java:3439) at com.goldencode.testcases.util.X3cc1session$1.body(X3cc1session.java:62) at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983) at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890) at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194) at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180) at com.goldencode.testcases.util.X3cc1session.execute(X3cc1session.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153) at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513) at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019) at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76) at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675) at com.goldencode.p2j.net.Conversation.block(Conversation.java:316) at com.goldencode.p2j.net.Conversation.run(Conversation.java:158) at java.lang.Thread.run(Thread.java:662) Caused by: com.goldencode.p2j.persist.PersistenceException: Customer record has NO-LOCK status, update to field not allowed at com.goldencode.p2j.persist.RecordBuffer.upgradeLock(RecordBuffer.java:4284) at com.goldencode.p2j.persist.RecordBuffer$Handler.invoke(RecordBuffer.java:7335) at com.goldencode.p2j.persist.$Proxy1.setName(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.goldencode.p2j.persist.FieldReference.set(FieldReference.java:540) at com.goldencode.p2j.ui.Element.set(Element.java:333) at com.goldencode.p2j.ui.BrowseColumnWidget.setValue(BrowseColumnWidget.java:261) at com.goldencode.p2j.ui.BrowseWidget.updateRow(BrowseWidget.java:1085) at com.goldencode.p2j.ui.LogicalTerminal.updateRow(LogicalTerminal.java:6735) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76) at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675) at com.goldencode.p2j.net.Conversation.block(Conversation.java:316) at com.goldencode.p2j.net.Conversation.waitMessage(Conversation.java:254) at com.goldencode.p2j.net.Queue.transactImpl(Queue.java:1107) at com.goldencode.p2j.net.Queue.transact(Queue.java:575) at com.goldencode.p2j.net.BaseSession.transact(BaseSession.java:178) at com.goldencode.p2j.net.HighLevelObject.transact(HighLevelObject.java:163) at com.goldencode.p2j.net.RemoteObject$RemoteAccess.invokeCore(RemoteObject.java:1406) at com.goldencode.p2j.net.InvocationStub.invoke(InvocationStub.java:97) at $Proxy0.waitFor(Unknown Source) at com.goldencode.p2j.ui.LogicalTerminal.waitFor(LogicalTerminal.java:3671) at com.goldencode.p2j.ui.LogicalTerminal.waitFor(LogicalTerminal.java:3439) at com.goldencode.testcases.util.X3cc1session$1.body(X3cc1session.java:62) at com.goldencode.p2j.util.BlockManager.processBody(BlockManager.java:6983) at com.goldencode.p2j.util.BlockManager.topLevelBlock(BlockManager.java:6890) at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:194) at com.goldencode.p2j.util.BlockManager.externalProcedure(BlockManager.java:180) at com.goldencode.testcases.util.X3cc1session.execute(X3cc1session.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.goldencode.p2j.util.Utils.invoke(Utils.java:1153) at com.goldencode.p2j.main.StandardServer$MainInvoker.execute(StandardServer.java:1513) at com.goldencode.p2j.main.StandardServer.invoke(StandardServer.java:1019) at com.goldencode.p2j.main.StandardServer.standardEntry(StandardServer.java:320) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.goldencode.p2j.util.MethodInvoker.invoke(MethodInvoker.java:76) at com.goldencode.p2j.net.Dispatcher.processInbound(Dispatcher.java:675) at com.goldencode.p2j.net.Conversation.block(Conversation.java:316) at com.goldencode.p2j.net.Conversation.run(Conversation.java:158) at java.lang.Thread.run(Thread.java:662)
#2 Updated by Eric Faulhaber over 11 years ago
Please attach your test database's *.df file (and *.d file(s), if any), so that the worker of this issue can run the testcase.
#3 Updated by Ovidiu Maxiniuc over 11 years ago
- File p2j_test.df added
.df file attached.
.d file is irrelevant.