GigaSpaces XAP 9.7.2 API

org.openspaces.persistency.hibernate
Class DefaultHibernateSpaceSynchronizationEndpoint

java.lang.Object
  extended by com.gigaspaces.sync.SpaceSynchronizationEndpoint
      extended by org.openspaces.persistency.patterns.ManagedEntriesSpaceSynchronizationEndpoint
          extended by org.openspaces.persistency.hibernate.AbstractHibernateSpaceSynchronizationEndpoint
              extended by org.openspaces.persistency.hibernate.DefaultHibernateSpaceSynchronizationEndpoint

public class DefaultHibernateSpaceSynchronizationEndpoint
extends AbstractHibernateSpaceSynchronizationEndpoint

The default Hibernate SpaceSynchronizationEndpoint implementation. Based on Hibernate Session.

Since:
9.5
Author:
eitany

Field Summary
 
Fields inherited from class org.openspaces.persistency.hibernate.AbstractHibernateSpaceSynchronizationEndpoint
logger
 
Constructor Summary
DefaultHibernateSpaceSynchronizationEndpoint(org.hibernate.SessionFactory sessionFactory, Set<String> managedEntries, boolean useMerge, boolean deleteById)
           
 
Method Summary
protected  Serializable getIdentifier(Object o)
          Extracts and returns the hibernate object identifier
 void onOperationsBatchSynchronization(OperationsBatchData batchData)
          Perform the given batch changes using Hibernate Session.
 void onTransactionSynchronization(TransactionData transactionData)
          Perform the given transaction changes using Hibernate Session.
 
Methods inherited from class org.openspaces.persistency.hibernate.AbstractHibernateSpaceSynchronizationEndpoint
filterItemValue, getManagedEntries, getPartialUpdateHQL, getSessionFactory, isManaged, rollbackTx
 
Methods inherited from class com.gigaspaces.sync.SpaceSynchronizationEndpoint
afterOperationsBatchSynchronization, afterTransactionSynchronization, onAddIndex, onIntroduceType, onTransactionConsolidationFailure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHibernateSpaceSynchronizationEndpoint

public DefaultHibernateSpaceSynchronizationEndpoint(org.hibernate.SessionFactory sessionFactory,
                                                    Set<String> managedEntries,
                                                    boolean useMerge,
                                                    boolean deleteById)
Method Detail

onTransactionSynchronization

public void onTransactionSynchronization(TransactionData transactionData)
Perform the given transaction changes using Hibernate Session.

Note, this implementation relies on Hibernate NonUniqueObjectException in case the entity is already associated with the given session, and in such a case, will result in performing merge operation (which is more expensive).

Overrides:
onTransactionSynchronization in class SpaceSynchronizationEndpoint
Parameters:
transactionData - the transaction data

onOperationsBatchSynchronization

public void onOperationsBatchSynchronization(OperationsBatchData batchData)
Perform the given batch changes using Hibernate Session.

Note, this implementation relies on Hibernate NonUniqueObjectException in case the entity is already associated with the given session, and in such a case, will result in performing merge operation (which is more expensive).

Overrides:
onOperationsBatchSynchronization in class SpaceSynchronizationEndpoint
Parameters:
batchData - the batched operations data

getIdentifier

protected Serializable getIdentifier(Object o)
Extracts and returns the hibernate object identifier

Parameters:
o -
Returns:
serializable

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.