Since the flush time now becomes accessible programmatically this is a
better additional alternative to just the batch flush.
+1 to not triggering a Hibernate core flush.
+1 to the name. It says exactly what it does.
John G.
-----Original Message-----
From: hibernate-dev-bounces(a)lists.jboss.org
[mailto:hibernate-dev-bounces@lists.jboss.org] On Behalf Of
hibernate-dev-request(a)lists.jboss.org
Sent: Saturday, June 21, 2008 10:00 AM
To: hibernate-dev(a)lists.jboss.org
Subject: hibernate-dev Digest, Vol 24, Issue 19
Send hibernate-dev mailing list submissions to
hibernate-dev(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/hibernate-dev
or, via email, send a message with subject or body 'help' to
hibernate-dev-request(a)lists.jboss.org
You can reach the person managing the list at
hibernate-dev-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of hibernate-dev digest..."
Today's Topics:
1. [Hibernate Search] session.flushToIndexes() (Emmanuel Bernard)
----------------------------------------------------------------------
Message: 1
Date: Sat, 21 Jun 2008 15:49:02 +0200
From: Emmanuel Bernard <emmanuel(a)hibernate.org>
Subject: [hibernate-dev] [Hibernate Search] session.flushToIndexes()
To: hibernate-dev(a)lists.jboss.org
Message-ID: <611FEB50-98B7-4BEE-B238-0A1168A07B9F(a)hibernate.org>
Content-Type: text/plain; charset="us-ascii"
I never liked the way we work around mass insertion and OOME today
hibernate.search.worker.batch_size has many drawbacks
- the value is not accessible programatically
- it applies to any operations regardless of mass indexing
- it is used 99% of the time in close conjunction with a % and
session.clear()
- the side effect is quite big as the index is "transactionally"
committed
To replace it, I introduced
session.flushToIndexes();
this method manually triggers changes in queue. It does not trigger an
hibernate core flush().
This seems more reasonable and will make the code safer.
WDYT? Better name?
--
Emmanuel Bernard
emmanuel(a)hibernate.org
http://in.relation.to
http://blog.emmanuelbernard.com
http://twitter.com/emmanuelbernard