views:

121

answers:

1

i saw that i can use SessionScope and have inserts inside the scope of the SessionScope and do flush at the end of the scope.

my question is if i can define in some way that after, let's say, every 10 insertions/saves of objects, that they will automatically be flushed to the db.

in other words i want to be able to configure the way i use flush with castle active record.

p.s: is there any way to configure cascading behavior for objects like in NHibernate?

A: 

You could hook up your own IPostInsertEventListener where you keep track of insertion count and flush accordingly. But I recommend against this unless you have some very good reasons to do so.

The relevant attributes have a Cascade property to set cascading behavior. See for example HasMany.

Mauricio Scheffer