A lock, refresh or check cannot be performed. . .

Phyllis

Member²
I'm getting an error when trying to apply updates to an inserted record. The error is "A lock refresh or check cannot be performed without a rowid. Provide a rowid in the query or handle this action in the OnApplyRecord event." My query does use a rowid.

My properties for the component are:
CachedUpdates := True
RefreshOptions := [roBeforeEdit]
LockingMode := lmCheckImmediate

The error message is displayed when running Session,ApplyUpdates([Dataset], True) and after the OnApplyRecord event has gone through and inserted the record and as it loops through to do a refresh. I'm actually not clear on why it is attempting to do a refresh here, based on my refresh options.

What am I doing wrong here? If you need more code samples, I'm happy to provide them.

Thank you!
 
Hi Marco,

Here is the select statement. I have others that are similar which cause the same problem, all have the rowid. . .

SELECT lan.ROWID, lan.lan_no, lan_geo_no, lan_lns_no, lan_name, lan_studio_priority_bool, lan_alternate_lan_no,
lan_comments, lan_list_bool, lan_joshua_list_bool, lan_percent_literate, lan_dialect_bool, lan_search_name,
lan.ISOCode(lan_no) iso_code,
SUBSTR(misc.UserNameFromID(lan.created_by), 1, 30) created_by, lan.created_sdate,
SUBSTR(misc.UserNameFromID(lan.updated_by), 1, 30) updated_by, lan.updated_sdate
FROM languages lan
where lan_no = :lan_no
 
This looks okay. The rowid is obviously present, and belongs to the languages table or view.

Are you sure the error message applies to this dataset?
 
This is certainly happening on this dataset, which is the master for 4 others. They are all set up in the exact same way, with row_id and OnApplyRecord.

As I mentioned before, this is happening after the insert and on the Refresh part of the statement, which I am not handling, because I simply want the standard refresh to run. . .

What is my next step for tracking the problem down?
 
Can you isolate the dataset into a small demo project and send it to me by e-mail? Also include the creation DDL for the table(s) involved.
 
Did you receive the sample, Marco? I haven't heard anything back at all. Could you give an estimate on when I might expect a response?

Thank you!
 
Did you get the sample this time, Marco? And if not, will you check to see if for some reason a spam filter caught it? Not that it should sound like spam at all, but with the attached zip file. . .
 
No, I did not. Did your send your file as executable or as a zip file with an executable? If so, can you omit the executable? I just need the source files.
 
I just tried re-sending again, this time I renamed the zip file to .zi~. Hopefully that will allow it to reach you.
 
Have you gotten the file yet, Marco? If not, will you please check your spam folder or give me some other way to get it to you? We have an upgrade project that is pretty much on hold for an answer for this and we have to have a solution soon so we can move on.

Thank you.
 
Hi Marco,

I was able to isolate the problem further and you might not need the sample application at all. The problem occurs when the dataset that we were inserting into has a "DefaultExpression" defined for one of the fields. Our OnApplyRecord method is not returning a row id, so when the required refresh is taking place, there isn't a row id then and the check is failing.

It is only now that I know this that I realize that there are more actions that must be handled in this method than the update, insert and delete that I have handled. So the problem is that I didn't handle the code properly by returning the rowId in my insert, but because of my refresh options, it wasn't a problem for any of my other datasets than this one.
 
Back
Top