Re: [SqueakDBX] Should "GlorpSession>>register:" work?

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

Re: [SqueakDBX] Should "GlorpSession>>register:" work?

Mariano Martinez Peck
Hi Panu. If it is not what Diogenes say, you can ask the main glorp mailing list. Sometimes when the problem is really related to Glorp internals we don't know as much as Alan (the real author and developer of Glorp).

Cheers


On Fri, May 20, 2011 at 9:51 AM, Panu Suominen <[hidden email]> wrote:
We have problem with reattaching objects to new session.

Following code throws exception telling that connection is not open.
|person|
KLDatabase withSession: [:s|
       person := s readOneOf: KLPerson where: [:p| p id = 6127].
].

KLDatabase withSession: [:s|
       s inUnitOfWorkDo: [
               self halt.
               s register: person.
               Transcript show: person parameters.
       ]
].

The problem seems to be that "GlorpSession>>register:" does not check
if there is an Glorp proxy inside the object being registered.
Tutorial (http://www.eli.sdsu.edu/SmalltalkDocs/GlorpTutorial.pdf)
states that it should reattach any nested objects (proxies) too but it
does not.

Is this known problem or am I doing something wrong? I can try to fix
this if this is an actual bug. Of course using refresh:
one can avoid this problem but it causes unnecessary database reads to occur.


--
Panu
_______________________________________________
SqueakDBX mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/squeakdbx



--
Mariano
http://marianopeck.wordpress.com

--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/glorp-group?hl=en.