Hi Balaji.

Check documentation about multiple calls to %OpenId() method

http://194.170.3.18:1972/csp/docbook/DocBook.UI.Page.cls?KEY=GOBJ_persistence#GOBJ_C1654

Warlin Garc�a

"Balaji.R" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi All,
>
> I am perplexed about the strategy of handling the objects in Cach�.
>
> Let me explain my question with an example.
>
> set objEmp1=##class(Employee.EmpDetails).%OpenId(1)
> Write !,objEmp1.MiddleInitial
> Output: T
>
> set objEmp1.MiddleInitial="A"
> Write !,objEmp1.MiddleInitial
> Output: A
>
> without saving this instance, I tried to create another instance for this
> class and ID.
>
> set objEmp2=##class(Employee.EmpDetails).%OpenId(1)
> Write !,objEmp2.MiddleInitial
> Output: A
>
> My question is,
>
> When I tried to change the MiddleInitial using the first instance objEmp1,
I
> could find the MiddleInitial updated with 'A' for the instance objEmp1.
But
> without saving or killing the instance objEmp1, when I tried to create
> another instance of the same class and ID say objEmp2, and output the
> MiddleInitial value, the value which was set for objEmp1 was displayed for
> objEmp2's property also.
>
> How could the multiple instances share the same value without any
> updation/saving made to the prior instance ? How the values are handled
for
> the instances?
>
> Kindly Clarify. FYI, I am using Cach� 5.0
>
> Thanks in Advance.
>
> -Balaji
>
>



Reply via email to