>From what I've experienced using batching in h2 isn't useful. It
doesn't speed up embedded mode, and it is slower than running the
statements one at a time in server mode.

I read someone stating in the forums that getGeneratedKeys() only
returns that last id not a series of ids so it can't be used for batch
updates with an auto increment pk if you have anything that references
the pk.

If I were you I wouldn't do batch updates with h2 because there
doesn't appear to be any benefit to do so. I know using batching for
almost every database our there is really useful for speeding up
operations but h2 is the exception.

Brish

On Aug 28, 2:06 pm, Richard <[EMAIL PROTECTED]> wrote:
> Thanks for the quick reply.
>
> I am running h2 in embedded mode, and your are right - its blazingly
> fast getting next value before each insert.
>
> So you think it might be such an insignificant speed up that its not
> really worth it?
>
> In any case, I am still interested to learn about whether the
> getGeneratedKeys() approach is possible with batch updates - because I
> could use an auto incremented PK and avoid the sequence all together.
>
> Thanks,
> Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to