Examples of lock()


Examples of org.gradle.api.internal.initialization.ClassLoaderScope.lock()

    public ClassLoaderScope buildAndCreateClassLoader(StartParameter startParameter) {
        ClassPath classpath = createBuildSourceClasspath(startParameter);
        ClassLoaderScope childScope = classLoaderScope.createChild();
        childScope.export(classpath);
        childScope.lock();
        return childScope;
    }

    ClassPath createBuildSourceClasspath(StartParameter startParameter) {
        assert startParameter.getCurrentDir() != null && startParameter.getBuildFile() == null;
View Full Code Here

Examples of org.h2.store.FileLock.lock()

        File f = new File(getFile());
        f.delete();
        f.createNewFile();
        f.setLastModified(System.currentTimeMillis() + 10000);
        FileLock lock = new FileLock(new TraceSystem(null), getFile(), Constants.LOCK_SLEEP);
        lock.lock(FileLock.LOCK_FILE);
        lock.unlock();
    }

    private void testSimple() {
        FileLock lock1 = new FileLock(new TraceSystem(null), getFile(), Constants.LOCK_SLEEP);
View Full Code Here

Examples of org.h2.table.Table.lock()

        session.commit(true);
        Database db = session.getDatabase();
        boolean persistent = db.isPersistent();
        Table table = getSchema().getTableOrView(session, tableName);
        session.getUser().checkRight(table, Right.ALL);
        table.lock(session, true, true);
        if (!table.isPersistIndexes()) {
            persistent = false;
        }
        int id = getObjectId();
        if (indexName == null) {
View Full Code Here

Examples of org.hibernate.Session.lock()

          // obtain update lock by default (LockMode.UPGRADE)
          LockMode lockMode = parentLockMode != null ? LockMode.parse(parentLockMode)
              : LockMode.UPGRADE;
          log.debug("acquiring " + lockMode + " lock on " + parentToken);
          // lock updates as appropriate, no need to flush here
          session.lock(parentToken, lockMode);
        }

        boolean reactivateParent = true;

        // if this is a discriminator
View Full Code Here

Examples of org.hibernate.cache.CacheConcurrencyStrategy.lock()

    assertTrue( !ccs.put("foo", "foo", before, null, null, false) );

    // update it:

    SoftLock lock = ccs.lock("foo", null);

    assertTrue( ccs.get("foo", after)==null );
    assertTrue( ccs.get("foo", longBefore)==null );

    assertTrue( !ccs.put("foo", "foo", before, null, null, false) );
View Full Code Here

Examples of org.hibernate.cache.ReadWriteCache.lock()

    assertTrue( !ccs.put("foo", "foo", before, null, null, false) );

    // update it:

    SoftLock lock = ccs.lock("foo", null);

    assertTrue( ccs.get("foo", after)==null );
    assertTrue( ccs.get("foo", longBefore)==null );

    assertTrue( !ccs.put("foo", "foo", before, null, null, false) );
View Full Code Here

Examples of org.hibernate.classic.Session.lock()

    s.connection().commit();
    s.close();

    s = openSession();
    Transaction tx = s.beginTransaction();
    s.lock(c, LockMode.UPGRADE);
    Category loaded = (Category) s.load( Category.class, new Long( c3.getId() ) );
    assertTrue( s.contains(c3) );
    assertTrue(loaded==c3);
    assertTrue( s.getCurrentLockMode(c3)==LockMode.NONE );
    assertTrue( s.getCurrentLockMode(c)==LockMode.UPGRADE );
View Full Code Here

Examples of org.hibernate.persister.entity.EntityPersister.lock()

              entry.getId(), entry.getVersion(), source
          );
          entry.forceLocked( object, nextVersion );
        }
        else {
          persister.lock( entry.getId(), entry.getVersion(), object, requestedLockMode, source );
        }
        entry.setLockMode(requestedLockMode);
      }
      finally {
        // the database now holds a lock + the object is flushed from the cache,
View Full Code Here

Examples of org.hornetq.core.paging.cursor.PageCache.lock()

               cache = createPageCache(pageId);
               needToRead = true;
               // anyone reading from this cache will have to wait reading to finish first
               // we also want only one thread reading this cache
               cache.lock();
               if (isTrace)
               {
                  HornetQServerLogger.LOGGER.trace("adding " + pageId +  " into cursor = " + this.pagingStore.getAddress());
               }
               softCache.put(pageId, cache);
View Full Code Here

Examples of org.infinispan.AdvancedCache.lock()

    EntityKey key = EntityKeyBuilder.fromData(
        ( (OgmEntityPersister) lockable).getRootEntityKeyMetadata(),
        identifierGridType,
        id,
        session );
    advCache.lock( key );
    //FIXME check the version number as well and raise an optimistic lock exception if there is an issue JPA 2 spec: 3.4.4.2
  }

  private InfinispanDatastoreProvider getProvider(SessionImplementor session) {
    if ( provider == null ) {
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.