We don't have any explicit support for such batching with repeated flush and
clear calls. However, it should be easy enough to use based on the existing
HibernateTemplate: Simply code such a loop yourself, performing repeated
HibernateTemplate.flush/clear calls - all within a managed transaction, of
course.
Alternatively, implement a HibernateCallback and perform the iteration
directly on the given Session reference. That would simply be executed
through HibernateTemplate.execute, typically with the HibernateCallback
passed in as anonymous class. The advantage of this variant is the full, raw
access to the Hibernate Session.
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...] On Behalf Of
David Dodini
Sent: Friday, March 03, 2006 1:07 AM
To: spr...@li...
Subject: [Springframework-developer] Hibernate Batch Support
Hi,
I have been using Spring for 8 months now, and it is fantastic. Thank you to
everyone who conceived, designed and built this very cool software.
I would like to take advantage of the Hibernate 3 batch insert/update/delete
support. I would like to do it using the HibernateTemplate. The bulkUpdate
and saveOrUpdateAll methods appear to have the semantic that implies support
for Hibernate 3 batching. The javadoc didn't explicitly say they do, so I
read through the source and it doesn't appear to implement any variant of
the 'session flush when iteration count % hibernate.jdbc.batch_size == 0'
algorithm outlined in Hibernate's documentation. (See
http://www.hibernate.org/hib_docs/v3/reference/en/html/batch.html#batch-inse
rts)
Has this been implemented using an aspect that manages the flushing or in
some other place that I am not aware of? I couldn't find any discussion of
this on the dev mail archive. If there is no solution that has already been
provided, then I am happy to submit the batchUpdate; batchSaveOrUpdate ...
implementations. I should mention that I am using Spring 1.2.6 and read
through the 2.0-M2 source and javadoc to see if it was addressed in that
release.
Thanks for your consideration.
- David
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|