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

How to use
IllegalLoopbackException
in
javax.ejb

Best Java code snippets using javax.ejb.IllegalLoopbackException (Showing top 7 results out of 315)

origin: wildfly/wildfly

@Override
public final IllegalLoopbackException failToUpgradeToWriteLock() {
  final IllegalLoopbackException result = new IllegalLoopbackException(String.format(getLoggingLocale(), failToUpgradeToWriteLock$str()));
  final StackTraceElement[] st = result.getStackTrace();
  result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
  return result;
}
private static final String componentIsNull = "WFLYEJB0239: %s cannot be null";
origin: com.caucho/resin

public static void lockWrite(ReentrantReadWriteLock lock)
{
 if (lock.getReadHoldCount() > 0
   && lock.getWriteHoldCount() == 0) {
  throw new IllegalLoopbackException(L.l("Cannot attempt a nested write lock without an existing write lock."));
 }
 
 lock.writeLock().lock();
}

origin: com.caucho/resin

 public static void lockWrite(ReentrantReadWriteLock lock,
                long timeout)
 {
  if (lock.getReadHoldCount() > 0
    && lock.getWriteHoldCount() == 0) {
   throw new IllegalLoopbackException(L.l("Cannot attempt a nested write lock without an existing write lock."));
  }
  
  try {
   if (! lock.writeLock().tryLock(timeout, TimeUnit.MILLISECONDS))
    throw new ConcurrentAccessTimeoutException(L.l("Timed out acquiring write lock {0}ms.",
                            timeout));
  } catch (InterruptedException e) {
   throw new ConcurrentAccessTimeoutException(L.l("Thread interruption acquiring write lock: " + e.getMessage()));
  }
 }
}
origin: org.glassfish.main.ejb/ejb-container

private void handleConcurrentInvocation(boolean allowSerializedAccess,
                    EjbInvocation inv, SessionContextImpl sc, Object sessionKey) {
  if (_logger.isLoggable(TRACE_LEVEL)) {
    logTraceInfo(inv, sessionKey, "Another invocation in progress");
  }
  if( allowSerializedAccess ) {
    // Check for loopback call to avoid deadlock.
    if( sc.getStatefulWriteLock().getHoldCount() > 1 ) {
      throw new IllegalLoopbackException("Illegal Reentrant Access : Attempt to make " +
          "a loopback call on method '" + inv.beanMethod + " for stateful session bean " +
          ejbDescriptor.getName());
    }
  } else {
    String errMsg = "Concurrent Access attempt on method " +
        inv.beanMethod + " of SessionBean " + ejbDescriptor.getName() +
        " is prohibited.  SFSB instance is executing another request. "
      + "[session-key: " + sessionKey + "]";
    ConcurrentAccessException conEx = new ConcurrentAccessException(errMsg);
    if (inv.isBusinessInterface) {
      throw conEx;
    } else {
      // there is an invocation in progress for this instance
      // throw an exception (EJB2.0 section 7.5.6).
      throw new EJBException(conEx);
    }
  }
}
origin: org.glassfish.ejb/ejb-container

private void handleConcurrentInvocation(boolean allowSerializedAccess,
                    EjbInvocation inv, SessionContextImpl sc, Object sessionKey) {
  if (_logger.isLoggable(TRACE_LEVEL)) {
    logTraceInfo(inv, sessionKey, "Another invocation in progress");
  }
  if( allowSerializedAccess ) {
    // Check for loopback call to avoid deadlock.
    if( sc.getStatefulWriteLock().getHoldCount() > 1 ) {
      throw new IllegalLoopbackException("Illegal Reentrant Access : Attempt to make " +
          "a loopback call on method '" + inv.beanMethod + " for stateful session bean " +
          ejbDescriptor.getName());
    }
  } else {
    String errMsg = "Concurrent Access attempt on method " +
        inv.beanMethod + " of SessionBean " + ejbDescriptor.getName() +
        " is prohibited.  SFSB instance is executing another request. "
      + "[session-key: " + sessionKey + "]";
    ConcurrentAccessException conEx = new ConcurrentAccessException(errMsg);
    if (inv.isBusinessInterface) {
      throw conEx;
    } else {
      // there is an invocation in progress for this instance
      // throw an exception (EJB2.0 section 7.5.6).
      throw new EJBException(conEx);
    }
  }
}
origin: org.glassfish.ejb/ejb-container

 (!rwLock.isWriteLockedByCurrentThread()) ) {
if( lockInfo.isWriteLockedMethod() ) {
  throw new IllegalLoopbackException("Illegal Reentrant Access : Attempt to make " +
      "a loopback call on a Write Lock method '" + invInfo.targetMethod1 +
      "' while a Read lock is already held");
origin: org.glassfish.main.ejb/ejb-container

 (!rwLock.isWriteLockedByCurrentThread()) ) {
if( lockInfo.isWriteLockedMethod() ) {
  throw new IllegalLoopbackException("Illegal Reentrant Access : Attempt to make " +
      "a loopback call on a Write Lock method '" + invInfo.targetMethod1 +
      "' while a Read lock is already held");
javax.ejbIllegalLoopbackException

Javadoc

This exception indicates that an attempt was made to perform an illegal loopback invocation on a Singleton with container-managed concurrency. One possible cause is a loopback call to a WRITE method where the current thread does not already hold a WRITE lock.

Most used methods

  • <init>
    Build an exception with the given message.
  • getStackTrace
  • setStackTrace

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top plugins for WebStorm
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