Tabnine Logo
ConcurrencyException
Code IndexAdd Tabnine to your IDE (free)

How to use
ConcurrencyException
in
org.eclipse.persistence.exceptions

Best Java code snippets using org.eclipse.persistence.exceptions.ConcurrencyException (Showing top 20 results out of 315)

origin: org.eclipse.persistence/org.eclipse.persistence.core

public static ConcurrencyException waitFailureOnClientSession(InterruptedException exception) {
  Object[] args = {  };
  ConcurrencyException concurrencyException = new ConcurrencyException(ExceptionMessageGenerator.buildMessage(ConcurrencyException.class, WAIT_FAILURE_CLIENT, args), exception);
  concurrencyException.setErrorCode(WAIT_FAILURE_CLIENT);
  return concurrencyException;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Decrement the number of readers.
 * Used to allow concurrent reads.
 */
public synchronized void releaseReadLock() throws ConcurrencyException {
  if (this.numberOfReaders == 0) {
    throw ConcurrencyException.signalAttemptedBeforeWait();
  } else {
    this.numberOfReaders--;
  }
  if (this.numberOfReaders == 0) {
    notifyAll();
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public synchronized Accessor acquireAccessor() {
  if (isBusy) {
    try {
      wait();// Notify is called when connection is released.
    } catch (InterruptedException exception) {
      throw ConcurrencyException.waitFailureOnSequencingForDatabaseSession(exception);
    }
  }
  isBusy = true;
  return accessor;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Wait on any writer.
 * Allow concurrent reads.
 */
public synchronized void acquireReadLock() throws ConcurrencyException {
  // Cannot check for starving writers as will lead to deadlocks.
  while ((this.activeThread != null) && (this.activeThread != Thread.currentThread())) {
    try {
      wait();
    } catch (InterruptedException exception) {
      throw ConcurrencyException.waitWasInterrupted(exception.getMessage());
    }
  }
  this.numberOfReaders++;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

  public synchronized Object waitForObject(){
    try {
      int count = 0;
      while (this.object == null && isAcquired()) {
        if (count > MAX_WAIT_TRIES)
          throw ConcurrencyException.maxTriesLockOnBuildObjectExceded(getActiveThread(), Thread.currentThread());
        wait(10);
        ++count;
      }
    } catch(InterruptedException ex) {
      //ignore as the loop is broken
    }
    return this.object;
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

throw ConcurrencyException.waitFailureOnServerSession(exception);
origin: org.eclipse.persistence/org.eclipse.persistence.core

if ((toWaitOn != null) && ((++tries) > MAXTRIES)) {
  throw ConcurrencyException.maxTriesLockOnCloneExceded(objectForClone);
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  wait(this.waitTimeout);// Notify is called when connections are released.
} catch (InterruptedException exception) {
  throw ConcurrencyException.waitFailureOnClientSession(exception);
origin: com.haulmont.thirdparty/eclipselink

/**
 * Wait on any writer.
 * Allow concurrent reads.
 */
public synchronized void acquireReadLock() throws ConcurrencyException {
  // Cannot check for starving writers as will lead to deadlocks.
  while ((this.activeThread != null) && (this.activeThread != Thread.currentThread())) {
    try {
      wait();
    } catch (InterruptedException exception) {
      throw ConcurrencyException.waitWasInterrupted(exception.getMessage());
    }
  }
  this.numberOfReaders++;
}
origin: com.haulmont.thirdparty/eclipselink

  public synchronized Object waitForObject(){
    try {
      int count = 0;
      while (this.object == null && isAcquired()) {
        if (count > MAX_WAIT_TRIES)
          throw ConcurrencyException.maxTriesLockOnBuildObjectExceded(getActiveThread(), Thread.currentThread());
        wait(10);
        ++count;
      }
    } catch(InterruptedException ex) {
      //ignore as the loop is broken
    }
    return this.object;
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Allocate the client's connection resource.
 */
public void acquireClientConnection(ClientSession clientSession) throws DatabaseException, ConcurrencyException {
  if (clientSession.getConnectionPolicy().isPooled()) {
    ConnectionPool pool = this.connectionPools.get(clientSession.getConnectionPolicy().getPoolName());
    Accessor accessor = pool.acquireConnection();
    clientSession.addWriteConnection(pool.getName(), accessor);
  } else {
    if (this.maxNumberOfNonPooledConnections != NO_MAX) {
      synchronized (this) {
        while (this.numberOfNonPooledConnectionsUsed >= this.maxNumberOfNonPooledConnections) {
          try {
            wait();// Notify is called when connections are released.
          } catch (InterruptedException exception) {
            throw ConcurrencyException.waitFailureOnServerSession(exception);
          }
        }
        this.numberOfNonPooledConnectionsUsed++;
      }
    }
    Accessor accessor = clientSession.getLogin().buildAccessor();
    clientSession.connect(accessor);
    clientSession.addWriteConnection(ServerSession.NOT_POOLED, accessor);
  }
}
origin: com.haulmont.thirdparty/eclipselink

if ((toWaitOn != null) && ((++tries) > MAXTRIES)) {
  throw ConcurrencyException.maxTriesLockOnCloneExceded(objectForClone);
origin: com.haulmont.thirdparty/eclipselink

  wait(this.waitTimeout);// Notify is called when connections are released.
} catch (InterruptedException exception) {
  throw ConcurrencyException.waitFailureOnClientSession(exception);
origin: com.haulmont.thirdparty/eclipselink

public static ConcurrencyException activeLockAlreadyTransitioned(Thread currentThread) {
  Object[] args = { currentThread};
  ConcurrencyException concurrencyException = new ConcurrencyException(ExceptionMessageGenerator.buildMessage(ConcurrencyException.class, ACTIVE_LOCK_ALREADY_TRANSITIONED, args));
  concurrencyException.setErrorCode(ACTIVE_LOCK_ALREADY_TRANSITIONED);
  return concurrencyException;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Wait on any writer.
 * Allow concurrent reads.
 */
public synchronized void acquireReadLock() throws ConcurrencyException {
  // Cannot check for starving writers as will lead to deadlocks.
  while ((this.activeThread != null) && (this.activeThread != Thread.currentThread())) {
    try {
      wait();
    } catch (InterruptedException exception) {
      throw ConcurrencyException.waitWasInterrupted(exception.getMessage());
    }
  }
  this.numberOfReaders++;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  public Object waitForObject(){
    synchronized (getMutex()) {
      try{
        int count = 0;
        while(this.object == null && this.isAcquired()){
          if (count > MAX_WAIT_TRIES)
            throw ConcurrencyException.maxTriesLockOnBuildObjectExceded(getMutex().getActiveThread(), Thread.currentThread());
          getMutex().wait(10);
          ++count;
        }
      }catch(InterruptedException ex){
        //ignore as the loop is broken
      }
      return this.object;
    }
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Decrement the number of readers.
 * Used to allow concurrent reads.
 */
public synchronized void releaseReadLock() throws ConcurrencyException {
  if (this.numberOfReaders == 0) {
    throw ConcurrencyException.signalAttemptedBeforeWait();
  } else {
    this.numberOfReaders--;
  }
  if (this.numberOfReaders == 0) {
    notifyAll();
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

public synchronized Accessor acquireAccessor() {
  if (isBusy) {
    try {
      wait();// Notify is called when connection is released.
    } catch (InterruptedException exception) {
      throw ConcurrencyException.waitFailureOnSequencingForDatabaseSession(exception);
    }
  }
  isBusy = true;
  return accessor;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

throw ConcurrencyException.waitFailureOnServerSession(exception);
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

if ((toWaitOn != null) && ((++tries) > MAXTRIES)) {
  throw ConcurrencyException.maxTriesLockOnCloneExceded(objectForClone);
org.eclipse.persistence.exceptionsConcurrencyException

Javadoc

Purpose: Concurrency deadlock or interupts will raise this exception.

Most used methods

  • <init>
    INTERNAL: TopLink exceptions should only be thrown by TopLink.
  • maxTriesLockOnBuildObjectExceded
  • maxTriesLockOnCloneExceded
  • setErrorCode
  • signalAttemptedBeforeWait
  • waitFailureOnClientSession
  • waitFailureOnSequencingForDatabaseSession
  • waitFailureOnServerSession
  • waitWasInterrupted

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now