@Override public SessionID handleSessionCreation(EJBSessionCreationInvocationContext context) throws Exception { AbstractTransaction transaction = context.getTransaction(); // While session requests currently only utilize the caller thread, // this will support any future use of a worker. Additionally hides // TX from other interceptors, providing consistency with standard // invocation handling. if (transaction == null) { transaction = transactionManager.getTransaction(); context.setTransaction(transaction); } setupStickinessIfRequired(context, true, transaction); Transaction old = transactionManager.suspend(); try { return context.proceed(); } finally { transactionManager.resume(old); } }
public <T> StatefulEJBLocator<T> openSession(final StatelessEJBLocator<T> statelessLocator, final ConnectionPeerIdentity identity, EJBSessionCreationInvocationContext clientInvocationContext) throws Exception { SessionOpenInvocation<T> invocation = invocationTracker.addInvocation(id -> new SessionOpenInvocation<>(id, statelessLocator, clientInvocationContext)); try (MessageOutputStream out = invocationTracker.allocateMessage()) { out.write(Protocol.OPEN_SESSION_REQUEST); out.writeShort(invocation.getIndex()); writeRawIdentifier(statelessLocator, out); if (version >= 3) { out.writeInt(identity.getId()); invocation.setOutflowHandle(writeTransaction(clientInvocationContext.getTransaction(), out)); } } catch (IOException e) { CreateException createException = new CreateException(e.getMessage()); createException.initCause(e); throw createException; } // await the response return invocation.getResult(); }
@Override public SessionID handleSessionCreation(EJBSessionCreationInvocationContext context) throws Exception { AbstractTransaction transaction = context.getTransaction(); // While session requests currently only utilize the caller thread, // this will support any future use of a worker. Additionally hides // TX from other interceptors, providing consistency with standard // invocation handling. if (transaction == null) { transaction = transactionManager.getTransaction(); context.setTransaction(transaction); } setupStickinessIfRequired(context, true, transaction); Transaction old = transactionManager.suspend(); try { return context.proceed(); } finally { transactionManager.resume(old); } }
@Override public SessionID handleSessionCreation(EJBSessionCreationInvocationContext context) throws Exception { AbstractTransaction transaction = context.getTransaction(); // While session requests currently only utilize the caller thread, // this will support any future use of a worker. Additionally hides // TX from other interceptors, providing consistency with standard // invocation handling. if (transaction == null) { transaction = transactionManager.getTransaction(); context.setTransaction(transaction); } setupStickinessIfRequired(context, true, transaction); Transaction old = transactionManager.suspend(); try { return context.proceed(); } finally { transactionManager.resume(old); } }
public <T> StatefulEJBLocator<T> openSession(final StatelessEJBLocator<T> statelessLocator, final ConnectionPeerIdentity identity, EJBSessionCreationInvocationContext clientInvocationContext) throws Exception { SessionOpenInvocation<T> invocation = invocationTracker.addInvocation(id -> new SessionOpenInvocation<>(id, statelessLocator, clientInvocationContext)); try (MessageOutputStream out = invocationTracker.allocateMessage()) { out.write(Protocol.OPEN_SESSION_REQUEST); out.writeShort(invocation.getIndex()); writeRawIdentifier(statelessLocator, out); if (version >= 3) { out.writeInt(identity.getId()); invocation.setOutflowHandle(writeTransaction(clientInvocationContext.getTransaction(), out)); } } catch (IOException e) { CreateException createException = new CreateException(e.getMessage()); createException.initCause(e); throw createException; } // await the response return invocation.getResult(); }
public <T> StatefulEJBLocator<T> openSession(final StatelessEJBLocator<T> statelessLocator, final ConnectionPeerIdentity identity, EJBSessionCreationInvocationContext clientInvocationContext) throws Exception { SessionOpenInvocation<T> invocation = invocationTracker.addInvocation(id -> new SessionOpenInvocation<>(id, statelessLocator, clientInvocationContext)); try (MessageOutputStream out = invocationTracker.allocateMessage()) { out.write(Protocol.OPEN_SESSION_REQUEST); out.writeShort(invocation.getIndex()); writeRawIdentifier(statelessLocator, out); if (version >= 3) { out.writeInt(identity.getId()); invocation.setOutflowHandle(writeTransaction(clientInvocationContext.getTransaction(), out)); } } catch (IOException e) { CreateException createException = new CreateException(e.getMessage()); createException.initCause(e); throw createException; } // await the response return invocation.getResult(); }