[Seaside] Seaside, Omnibase, OmnibaseSupport - markDirty failing

Dmitry Dorofeev dima-sender-3c337a at yasp.com
Mon Feb 20 15:50:11 UTC 2006


Hi,

Glad to see you managed to get it sorted, but still would say that
you didn't get 100% clue how it works :-)

see below.

Wilkes Joiner wrote:
> 
> 
> I got this working.  I learned a couple of things.  Executing the
> following raises "ODBError: Object is not persistent or is a part of
> composite persistent object"
> 
> |postRef|
> postRef := nil.
> 
> BLGDatabase current execute:
> 	[postRef := BLGPost new asPersistentReference].
> 
> BLGDatabase current execute:
> 	[postRef title: 't1'; body: 'b1'; markDirty]
> 
> However this does not:
> |postRef|
> postRef := nil.
> 
> BLGDatabase current execute:
> 	[postRef := BLGPost new asPersistentReference].

You can safely leave it as

BLGDatabase current execute:
 	[postRef := BLGPost new].

or even 
	postRef := BLGPost new
as here is no OmniBase operations at all.


> 
> BLGDatabase current execute:
> 	[postRef title: 't1'; body: 'b1'; makePersistent; markDirty]

finally it is the same as
BLGDatabase current execute:
 	[BGLPost new title: 't1'; body: 'b1'; makePersistent]

You don't need to markDirty on objects which just made Persistent ;-)
this will work as well:

BLGDatabase current execute: [
	post := BGLPost new.
	post makePersistent.
	post title: 't1'; body: 'b1'.
]

> 
> Since my component answers with a new Post, I just broke it up into a
> create component and an edit component. The method that calls the
> create sends the makePersistent to the Post before adding it to the
> persistent OrderedCollection.
> 
> BLGPostList>>newPost
> 	| post |
"hope you don't use transactions and omnibase calls in BLGCreatePost component
-Dmitry."
> 	post := self call: (BLGCreatePost new). 
> 	post makePersistent.
> 	self listing
> 		add: post;
> 		markDirty.
> 
> There is quite a bit more to say about this and I'll try to get
> something together after doing more complex stuff.
> 
> Thanks for everyones help,
> Wilkes
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


More information about the Seaside mailing list