0

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?

4

1 回答 1

0

IPostInsertEventListener您可以在跟踪插入计数并相应刷新的地方连接自己的。但我建议不要这样做,除非你有充分的理由这样做。

相关属性有一个 Cascade 属性来设置级联行为。参见例如HasMany

于 2009-09-02T22:54:18.963 回答