|
From: <leg...@at...> - 2003-08-07 16:23:41
|
Message:
The following issue has been closed.
Resolver: Gavin King
Date: Thu, 7 Aug 2003 11:02 AM
I've implemented this, finally.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-36
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-36
Summary: clear() the session cache
Type: New Feature
Status: Closed
Priority: Major
Resolution: FIXED
Project: Hibernate2
Fix Fors:
2.1 beta 1
Assignee: Gavin King
Reporter: Max Rydahl Andersen
Created: Sat, 3 May 2003 10:21 AM
Updated: Thu, 7 Aug 2003 11:02 AM
Description:
clear() the session cache
Like evict, but clears the entire session at once.
Useful for batch processing, where a large cache can
result in out of memory exceptions.
The standard use case would be a transaction where you
are updating many objects, and want to flush/clear
periodically:
int counter = 0;
while (it.hasNext()) {
Foo foo = (Foo)it.next();
foo.setBar(42);
if ((counter++ % 10000) == 0) {
session.flush();
session.clear();
}
}
The current workaround is to flush and evict after each
update, but here you lose the benefits of batched updates:
while (it.hasNext()) {
Foo foo = (Foo)it.next();
foo.setBar(42);
session.flush();
session.evict(foo);
}
http://sourceforge.net/tracker/index.php?func=detail&aid=728730&group_id=40712&atid=428711
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|