I alternate saving Dogs and Cats. For example:
Code:
for (int i = 0; i++; i< something) {
Dog dog = createDog();
session.save(dog);
Cat cat = createCat();
session.save(cat);
}
So I alternately save Dog's and Cat's, which effectively disallows Hibernate to take advantage of batch inserts. It looks like AbstractBatcher could be modified to keep a map of open prepared statements instead of just one, and allow batching for this type of situation. (maybe a new MultipleStatementBatcher subclass?)
I was just curious if either 1) I'm missing something, 2) someone else found a work around, or 3) I could get some guidance from the Hibernate folk on the best way to go about adding this type of feature into Hibernate, if in fact it doesn't exist.
Thanks,
Erik