OmniBase question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

OmniBase question

Bruno Buzzi Brasesco-2
Hi,

I have anObject that has been changed inside aPresenter.
(name, surname, etc).
But now I want to reload (in the same transaction) this object again to
obtain the (old) stored values (in the hard drive).

It is possible to do that ?

My solution:

OmniBaseSession
reloadObject: anObject
| reloadedObject |

transaction cacheTransactionObject: ((transaction objectHolderAt: anObject
objectId) getObject makeTransactionObject: transaction).
reloadedObject := self objectAt: anObject objectId.
^reloadedObject transaction: transaction " because #odbLoadedIn: is not
called "

Does anyone see any problem ? Or anything ?

Regards Bruno


Reply | Threaded
Open this post in threaded view
|

Re: OmniBase question

Bruno Buzzi Brasesco-2
Other Solution:

OmniBaseSession
reloadObject: anObject
| reloadedObject |

transaction removeCachedObjectID: anObject objectId.
reloadedObject := self objectAt: anObject objectId.
^reloadedObject transaction: transaction

> My solution:
>
> OmniBaseSession
> reloadObject: anObject
> | reloadedObject |
>
> transaction cacheTransactionObject: ((transaction objectHolderAt: anObject
> objectId) getObject makeTransactionObject: transaction).
> reloadedObject := self objectAt: anObject objectId.
> ^reloadedObject transaction: transaction " because #odbLoadedIn: is not
> called "
>
> Does anyone see any problem ? Or anything ?
>
> Regards Bruno
>
>