Hi,
that's the Uniface runtime default behaviour as soon as you are trying to modify (interactively by keyboard or by code in a Proc trigger) an occurrence your session have read from database and the same occurrence was already changed and committed into database from another session.
In this case the lock trigger at entity level is "reload"ing the most updated version, issuing a lock on that occurrence, sending you on the message line error 2012 and applying your modification (from keyboard or from code) to the occurrence.
If this description is not yet enough to help you to clearify the subject, please try to describe with more details what you want to achieve. 🙂
Regards,
Gianni
Hi,
that's the Uniface runtime default behaviour as soon as you are trying to modify (interactively by keyboard or by code in a Proc trigger) an occurrence your session have read from database and the same occurrence was already changed and committed into database from another session.
In this case the lock trigger at entity level is "reload"ing the most updated version, issuing a lock on that occurrence, sending you on the message line error 2012 and applying your modification (from keyboard or from code) to the occurrence.
If this description is not yet enough to help you to clearify the subject, please try to describe with more details what you want to achieve. 🙂
Regards,
Gianni
Thank you for quick reply Gianni.
I understand that the error is because the uniface screen had locked a record (occurrence your session have read from database) of a database table which is modified by another session. This looks appropriate to me!
But in my case there are no other active sessions (confirmed by checking v$session table) performing DML on the same table.
I can tell you more on the current change I did to legacy screen
There is a screen(screen1) with button , on clicking this button another screen/form (screen2) is initiated.
I have modified code in save button of screen2 and added an update statement in it so when the control returns back to the screen1 and refresh this error is thrown. On debugging I found the error below thrown, could you suggest how this can be fixed - should I remove the lock applied in screen1 on update table , if yes then how ?
"ERROR=-10·;
MNEM=<UIOSERR_LOCK_DATA_MISMATCH>·;
DESCRIPTION=Lock, data mismatch·;
COMPONENT=XYZ0231·;
PROCNAME=CP_MORE·;
TRIGGER=DTLF·;
LINE=8"
Thanks ,
Imran.
Hi,
that's the Uniface runtime default behaviour as soon as you are trying to modify (interactively by keyboard or by code in a Proc trigger) an occurrence your session have read from database and the same occurrence was already changed and committed into database from another session.
In this case the lock trigger at entity level is "reload"ing the most updated version, issuing a lock on that occurrence, sending you on the message line error 2012 and applying your modification (from keyboard or from code) to the occurrence.
If this description is not yet enough to help you to clearify the subject, please try to describe with more details what you want to achieve. 🙂
Regards,
Gianni
Hi Imran,
that's happens often in many applications:
there is a main screen showing some informations... user push a button on that main screen...the magic behind it happens (probably something like updating few occurrences you've already shown) and when you get back to main screen your application is warning with a 2012 error.
IMHO the rule should be to code a refresh of information shown into main screen, often just a clear/e followed by a retrieve/e, in the detail trigger of your button. In this way your 2012 error is automatically vanished!
Regards,
Gianni
Hi,
you say you have added an "update statement". Do you know that a direct sql statement sql "...." usually should be ended with a commit or rollback, at least for some database drivers. Or do I understand your "Update statement" wrong?
sql "update mytable......","def"
commit
Regards RogerW
Hi,
that's the Uniface runtime default behaviour as soon as you are trying to modify (interactively by keyboard or by code in a Proc trigger) an occurrence your session have read from database and the same occurrence was already changed and committed into database from another session.
In this case the lock trigger at entity level is "reload"ing the most updated version, issuing a lock on that occurrence, sending you on the message line error 2012 and applying your modification (from keyboard or from code) to the occurrence.
If this description is not yet enough to help you to clearify the subject, please try to describe with more details what you want to achieve. 🙂
Regards,
Gianni
Hi Gianni,
I was able to resolve the issue!
Removed the sql updates from screen2 and added them to screen1 as it is already having logic to fetch and update the data from table.
Much appreciate for time took for responses!
as I am newbee to Uniface can you advise me a doc or link than has basics (syntax) information.
Thanks,
Imran.
Hi,
you say you have added an "update statement". Do you know that a direct sql statement sql "...." usually should be ended with a commit or rollback, at least for some database drivers. Or do I understand your "Update statement" wrong?
sql "update mytable......","def"
commit
Regards RogerW
Hi Roger,
the update I added was correct followed by commit anyways I was able to fix the issue by moving that update from screen2 to 1 .
thanks for your time 🙂
Imran.
Hi,
that's the Uniface runtime default behaviour as soon as you are trying to modify (interactively by keyboard or by code in a Proc trigger) an occurrence your session have read from database and the same occurrence was already changed and committed into database from another session.
In this case the lock trigger at entity level is "reload"ing the most updated version, issuing a lock on that occurrence, sending you on the message line error 2012 and applying your modification (from keyboard or from code) to the occurrence.
If this description is not yet enough to help you to clearify the subject, please try to describe with more details what you want to achieve. 🙂
Regards,
Gianni
Hi Imran,
nice to hear you've solved your issue.
About documentation: you can find almost everything on this community site online:
- Top of documentation tree (you can find everything from here for any Uniface versions!)
While here just 3 common shortcuts:
- Uniface IDE Guide
- What's New in Uniface 10
- Uniface Reference
Regards,
Gianni
P.S. Sorry! I've linked U10 documentations...
...but I know you can find what you need starting from first link, right? 😉
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.