[Seaside] Seaside, Omnibase, OmnibaseSupport - markDirty failing

Wilkes Joiner wilkesjoiner at gmail.com
Sun Feb 19 18:13:14 UTC 2006


That is true, but BLGPost inherits from ODBSPersistentObject which
takes care of this for me, or at least tries to.  I changed it to
raise an error if it can't, just for debugging.  I think that there is
a problem with this, but I can't figure out what it is.  If I create
the objects in a workspace, I can modify them without any problems.

Creating in the workspace.
BLGDatabase current execute:
	[|post posts|
	post := BLGPost new.
	post title: '1'; body: 'body'.	
	posts := (OmniBase root at: #BLGPost).
	posts add: post; markDirty.
	post title: '2';].

When updating inside Seaside, I need to pass the post
asPersistentReference.  So I tried changing the post accessor to this

BLGPostEdit>>post
	^ post isNil
 		ifTrue:
			[BLGDatabase current execute:
				[post := BLGPost new asPersistentReference]]
		ifFalse: [post]

Didn't help.  I'm pretty sure that the problem is the way I am
creating new objects in Seaside.  I just have no idea how to fix it.

Thanks,
Wilkes


On 2/19/06, Bruno BB (st) <smalltalk at adinet.com.uy> wrote:
> Wilkes Joiner escribió:
>
> >I'm learning to use Seaside with Omnibase and am having some issues.
> >I'm getting a "ODBError: Object is not persistent or is a part of
> >composite persistent object" when calling markDirty on an object.
> >
> >
> This is because that object it was not make persistent.
> I mean, that do not receive the #makePersistent: message.
> Example:
>
> bank := Bank new.
> accout := Account new.
> bank addAccount: account.
> transaction makePersistent: bank.
> transaction commit.
>
> So, "bank" is a persistent object but "account" is a part of composite
> persistent object.
> After recover "bank" from repository you can not send #markDirty to
> "account".
> Only bank can receive #markDirty.
>
> What to do ?
>
> bank := Bank new.
> accout := Account new.
> bank addAccount: account.
> transaction makePersistent: bank;
>         makePersistent: account.  " NOW Account is a main persistent
> object (NOT a part of composite persistent object) "
> transaction commit.
>
> Regards Bruno
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the Seaside mailing list