OmniBase and Commits

Avi Bryant avi.bryant at gmail.com
Tue Apr 26 18:09:48 UTC 2005


On 4/26/05, Daniel Salama <dsalama at user.net> wrote:

> I'm trying to test uploading several thousand objects into an OmniBase
> db and I'm trying to figure out how to commit every 100th object. Can
> anyone shed some light into this? Every time I try something, it must
> be surrounded by a transaction, so I can't figure out how to do it.
> 
> I have stored a LinkedList to a root element. I have something similar
> to this:
> 
> txn := db newTransaction.
> 1 to: 1000 do: [:i|
> base := txn root at: 'linkedlist'.
> base add: anObject.
> (i \\ 100) = 0 ifTrue: [ txn commit. txn := db newTransaction]]
> 
> But this doesn't seem to work. Please help.

I would think it would be something like this:

10 timesRepeat: [
    [
      base := OmniBase root at: 'linkedlist'.
      100 timesRepeat: [base add: anObject]
    ] evaluateAndCommitIn: db newTransaction
]

Avi



More information about the Squeak-dev mailing list