Examples of CacheMode


Examples of org.hibernate.CacheMode

    refresh( entity, lockModeType, null );
  }

  public void refresh(Object entity, LockModeType lockModeType, Map<String, Object> properties) {
    checkTransactionNeeded();
    CacheMode previousCacheMode = getSession().getCacheMode();
    CacheMode localCacheMode = determineAppropriateLocalCacheMode( properties );
    LockOptions lockOptions = null;
    try {
      getSession().setCacheMode( localCacheMode );
      if ( !getSession().contains( entity ) ) {
        throw new IllegalArgumentException( "Entity not managed" );
View Full Code Here

Examples of org.hibernate.CacheMode

    if ( fetchSize != null && fetchSize < 0 ) {
      fetchSize = null;
    }

    FlushMode flushMode = getFlushMode( hints, QueryHints.FLUSH_MODE, name );
    CacheMode cacheMode = getCacheMode( hints, QueryHints.CACHE_MODE, name );

    boolean readOnly = getBoolean( hints, QueryHints.READ_ONLY, name );

    String comment = getString( hints, QueryHints.COMMENT );
    if ( StringHelper.isEmpty( comment ) ) {
View Full Code Here

Examples of org.hibernate.CacheMode

      EntityPersister persister,
      Object entity,
      EntityEntry entityEntry,
      Set transientEntities) throws HibernateException {

    CacheMode cacheMode = session.getCacheMode();
    session.setCacheMode( CacheMode.GET );
    session.getPersistenceContext().incrementCascadeLevel();
    try {
      // cascade-delete to collections BEFORE the collection owner is deleted
      new Cascade( CascadingAction.DELETE, Cascade.AFTER_INSERT_BEFORE_DELETE, session )
View Full Code Here

Examples of org.hibernate.CacheMode

      EventSource session,
      EntityPersister persister,
      Object entity,
      Set transientEntities) throws HibernateException {

    CacheMode cacheMode = session.getCacheMode();
    session.setCacheMode( CacheMode.GET );
    session.getPersistenceContext().incrementCascadeLevel();
    try {
      // cascade-delete to many-to-one AFTER the parent was deleted
      new Cascade( CascadingAction.DELETE, Cascade.BEFORE_INSERT_AFTER_DELETE, session )
View Full Code Here

Examples of org.hibernate.CacheMode

  public <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType) {
    return find( entityClass, primaryKey, lockModeType, null );
  }

  public <A> A find(Class<A> entityClass, Object primaryKey, LockModeType lockModeType, Map<String, Object> properties) {
    CacheMode previousCacheMode = getSession().getCacheMode();
    CacheMode cacheMode = determineAppropriateLocalCacheMode( properties );
    LockOptions lockOptions = null;
    try {
      getSession().setCacheMode( cacheMode );
      if ( lockModeType != null ) {
        return ( A ) getSession().get(
View Full Code Here

Examples of org.hibernate.CacheMode

    refresh( entity, lockModeType, null );
  }

  public void refresh(Object entity, LockModeType lockModeType, Map<String, Object> properties) {
    checkTransactionNeeded();
    CacheMode previousCacheMode = getSession().getCacheMode();
    CacheMode localCacheMode = determineAppropriateLocalCacheMode( properties );
    LockOptions lockOptions = null;
    try {
      getSession().setCacheMode( localCacheMode );
      if ( !getSession().contains( entity ) ) {
        throw new IllegalArgumentException( "Entity not managed" );
View Full Code Here

Examples of org.hibernate.CacheMode

      EntityPersister persister,
      Object entity,
      EntityEntry entityEntry,
      Set transientEntities) throws HibernateException {

    CacheMode cacheMode = session.getCacheMode();
    session.setCacheMode( CacheMode.GET );
    session.getPersistenceContext().incrementCascadeLevel();
    try {
      // cascade-delete to collections BEFORE the collection owner is deleted
      new Cascade( CascadingAction.DELETE, Cascade.AFTER_INSERT_BEFORE_DELETE, session )
View Full Code Here

Examples of org.infinispan.config.Configuration.CacheMode

      config.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
      config.setSyncReplTimeout(20000);
      config.setLockAcquisitionTimeout(15000);
      config.setCacheMode(local ? CacheMode.LOCAL : (totalReplication ? CacheMode.REPL_SYNC : CacheMode.DIST_SYNC));
     
      CacheMode mode = config.getCacheMode();

      config.setFetchInMemoryState(mode.isReplicated());
     
      // Block for commits -- no races between test driver and replication
      config.setSyncCommitPhase(true);
      config.setSyncRollbackPhase(true);
     
      if (passivationDir != null)
      {
         CacheLoaderManagerConfig managerConfig = new CacheLoaderManagerConfig();
         managerConfig.setPassivation(true);
         managerConfig.setPreload(!purgeCacheLoader);
        
         FileCacheStoreConfig fileConfig = new FileCacheStoreConfig();
         fileConfig.setLocation(passivationDir);
         fileConfig.setFetchPersistentState(mode.isReplicated());
         fileConfig.setPurgeOnStartup(purgeCacheLoader);
        
         managerConfig.setCacheLoaderConfigs(Collections.<CacheLoaderConfig>singletonList(fileConfig));
        
         config.setCacheLoaderManagerConfig(managerConfig);
View Full Code Here

Examples of org.infinispan.config.Configuration.CacheMode

      boolean isSkipLoader = isSkipLoader(flags);
      if ( ! isSkipLoader ) {
         // if we can't skip the cacheloader, we really want a thread for async.
         return false;
      }
      CacheMode cacheMode = config.getCacheMode();
      if ( ! cacheMode.isDistributed() ) {
         //in these cluster modes we won't RPC for a get, so no need to fork a thread.
         return true;
      }
      else if (flags != null && (flags.contains(Flag.SKIP_REMOTE_LOOKUP) || flags.contains(Flag.CACHE_MODE_LOCAL))) {
         //with these flags we won't RPC either
View Full Code Here

Examples of org.infinispan.config.Configuration.CacheMode

* @since 3.5
*/
public class TimestampTypeOverrides extends TypeOverrides {
   @Override
   public void validateInfinispanConfiguration(Configuration configuration) throws CacheException {
      CacheMode cacheMode = configuration.getCacheMode();
      if (cacheMode.equals(CacheMode.INVALIDATION_ASYNC) || cacheMode.equals(CacheMode.INVALIDATION_SYNC)) {
         throw new CacheException("Timestamp cache cannot be configured with invalidation");
      }
      EvictionStrategy strategy = configuration.getEvictionStrategy();
      if (!strategy.equals(EvictionStrategy.NONE)) {
         throw new CacheException("Timestamp cache cannot be configured with eviction");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.