This content has been marked as final. Show 3 replies
Seems like I managed to track down random RowInconsistentException happening in my simple application after creating a row and trying to modify it afterwards.
Thanks to this blog post: http://huysmansitt.blogspot.ch/2013/05/adf-bc-jbo-25014-another-user-has.html
That's what I found in debug mode on commit:
<oracle.adf.model> <OracleSQLBuilderImpl> <doEntitySelectForAltKey> < Executing LOCK...SELECT ... WHERE ID_APP_USER=:1 FOR UPDATE NOWAIT>
<oracle.adf.model> <OracleSQLBuilderImpl> <bindWhereAttrValue> < Where binding param 1: 1030>
<oracle.adf.model> <EntityImpl> <compare> < Entity compare failed for attribute DStart>
<oracle.adf.model> <EntityImpl> <compare> < Original value :2014-08-19 19:09:13.144>
<oracle.adf.model> <EntityImpl> <compare> < Target value :2014-08-19 19:09:13.0>
<oracle.adf.model> <DCBindingContainer> <reportException> < oracle.jbo.RowInconsistentException: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[1030 ].
DStart is timestamp attribute in my entity with adf.currentDateTime default value.
Now please correct me if I'm wrong: adf.currentDateTime value contains milliseconds and stores it in entity cache, but database DATE attribute format doesn't accept miliseconds and stores 0 instead of real miliseconds value - which is causing failure in comparison as Entity cache is sure that milliseconds = 144.
I'm the only user and PL triggers shouldn't do anything in this case.
If I'm correct, what would the proper solution for this? Set entity attribute format to "yyyy-MM-dd hh24:mi:ss"? Set Refresh on insert on this attribute? Or some other?
> Set entity attribute format to "yyyy-MM-dd hh24:mi:ss"?
Tried this, but didn't work. Why does it still stores milliseconds while it isn't in format?
>Set Refresh on insert on this attribute?
Works. Is it the best solution?