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

diogenes.moreira at gmail.com diogenes.moreira at gmail.com
Fri May 20 14:00:51 UTC 2011


You must use GlorpSession>>refresh: anObject to attach anObject to new Session

Best.
D
Enviado desde mi BlackBerry® de Claro Argentina

-----Original Message-----
From: Panu Suominen <panu.j.m.suominen at gmail.com>
Sender: squeakdbx-bounces at lists.squeakfoundation.org
Date: Fri, 20 May 2011 10:51:38 
To: The complete and open-source solution to relational database access<squeakdbx at lists.squeakfoundation.org>
Reply-To: panu.suominen at iki.fi,
	The complete and open-source solution to relational database access
	<squeakdbx at lists.squeakfoundation.org>
Subject: [SqueakDBX] Should "GlorpSession>>register:" work?

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
SqueakDBX at lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/squeakdbx


More information about the SqueakDBX mailing list