HI All - Recently we upgraded our system from 7.1.5 to 7.1.9 and we faced a really weird problem with Obj-Save. We have already existing activity which was performing Obj-Save for a page and Class of this page is mapped to an dedicated physical table(this table does not have primary key). Its actually stores comments entered by users on the cases. up until now everything seems working fine and Obj-Save used to insert an additional row in the table whenever users try to add new comment in the case, but after upgrading to 7.1.9 it seems same Obj-save step is overwriting all pervious case comments by the latest comment whenever user try to add new comment on the case.
Why I suspect it is problem with Obj-Save is that the problem was resolved by replacing Obj-Save by RDB-Save. There was no other change made except this. I dont know why Obj-save behaves differently in this particular scenario, but again if there is no change in Obj-Save behavior then why it was working up until now in 7.1.5.
Thank you Phani Sahukaru for your response!! I updated my post to say that my table does NOT have primary key. I did check the class key. The property specified on the class rule as key is a single value property and we do have index on that column in physical table but my table doesn't have any primary key defined yet. there was no change on class rule level or table level before and after upgrade.
Hi Murali Kakarla - Sorry for late response! I did get chance to trace DB query today and it seems instead of update table query it is forming merge table query when we use Obj-Save. Any idea when it happens? I never observed this kind of behavior before in pega.
Thank you Murali!!- But that doesn't matter as neither class definition nor underlying table(MY_CASE_CMNT) definition has been changed from last 1 year. I am wondering how it was working fine up until now in 7.1.5 before upgrade to 7.1.9.
As requested information the Class definition has keys defined as CO_KEY only though we don't have any primary key defined on the physical table.
Pega GCS will be right team to answer if anything related to Obj-Save has changed from 7.1.5 to 7.1.9
To me, merge statement does not look correct, this might be due to the reason that you have CO_KEY as the key in the class definition but the mapped table does not have a primary key. May be a bug in 7.1.5 has been rectified in 7.1.9
From Query generated by Obj-Save captured from tracer in 7.1.9, it seems it will insert row only if no matching row is found for given key(defined on class rule form). Can someone please confirm the actual underlying working of Obj-Save or refer me any document related to same. and how do we make sure that obj-save insert row and not overwrite existing rows for given key (defined on class rule form).
Thank you for your response Srikanth Challapilla! It seems right now in 7.1.9 this is not the case. In my scenario Class key column has CO_Key property specified as a key column on class rule form but table does not have primary key and when we trigger obj-save it seems it is overwriting all existing rows for give CO_Key value.