[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5773?page=c...
]
Steve Ebersole commented on HHH-5773:
-------------------------------------
Consider the following example:
{code}
Session session = ...;
SomeEntity someEntity = session.get( SomeEntity.class, 1 );
someEntity.setSomeAttribute( "some new value" );
session.flush();
session.setCacheMode( CacheMode.GET );
session.getTransaction().commit();
{code}
Currently the semantic is clear because the {{CacheMode}} does not affect the registration
of the {[AfterTransactionCompletionProcess}}, just its execution.
Given the requested change, the semantic is now that the {{CacheMode}} affects both. The
problem with that, however, is that the {{CacheMode}} is changeable between the 2 events.
So you end up with a choice as to which wins.
Disable registration of AfterTransactionCompletionProcess based on
Session CacheMode
------------------------------------------------------------------------------------
Key: HHH-5773
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5773
Project: Hibernate Core
Issue Type: Improvement
Components: caching (L2), core
Affects Versions: 3.6.0
Reporter: Emond Papegaaij
The session keeps track of all changes to entities in the 'actionQueue'. This
ActionQueue contains a AfterTransactionCompletionProcessQueue, which grows rapidly with
every change/insert/delete of entities. There seems to be no way to clear this queue,
other than to commit or rollback. I can understand that Hibernate needs to keep track of
changes in a transaction, but this list should not hold references to entities. Perhaps
references can be replaced by lazy proxies?
In our case, we are trying to import many (millions) records into the database. This
needs to be performed in a single transaction. These records reference entities in a
complex (and large) data-structure. The entities in this structure are not modified, but
as the ActionQueue contains all newly inserted records, which in turn reference the
entities in this structure, the entire structure ends up in the session. Flushing and
clearing has no effect.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira