2 Replies Latest reply on May 30, 2016 11:43 AM by erwin.etchart

    Jboss EAP Remote EJB invoke transaction

    erwin.etchart

      Hi all , in my company we are using Wildfly 8 , 10 and we are migrating to EAP7 using technologies EJB, JPA, WS, Activemq etc.

       

      In this moment we are developing a couple of apps, but i have a particular problem/question. I have application A (war packaged) and application B (war packaged), both are deployed in the same sever.

      App-A has a process (all EJB) that run  very fast without major problems, this process in certain moment needs to call a remote EJB (@Async) in the App-B doing a jndi lookup (because app-b can be deployed or not).

      While the process of App-A runs without the ejb remote call to App-B the disk usage , cpu etc looks very good , but once the call to App-B happens the disk becomes in a very high load.

      Inspecting (doing fatrace command) why this is happening i found that the directory  "standalone/data/tx-object-store/ShadowNoFileLockStore/defaultStore/StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction" creates a lot of files per seconds (creating and deleting), i assume that they are files created because new transactions.

       

      I been trying everything to disable transaction in order to avoid the file creation in this directory.

       

      Do you know how this can be solved?

       

      Thanks

       

      Erwin

        • 1. Re: Jboss EAP Remote EJB invoke transaction
          wdfink

          Hello,

          I don't get the problem. In general it depends on the transaction annotation whether a new transaction is created or not.

          But I have never seen that the Tx manager creates a lot of files.

           

          Could you expalin what you are doing? Maybe with the example code/project.

          Did you see this in a high concurrent environment or is it just one invocation for test?

          • 2. Re: Jboss EAP Remote EJB invoke transaction
            erwin.etchart

            Thanks for your response.

             

            App B has:

            
            
            @Stateless(name="TEST")
            @Remote(ITestService.class)
            public class TestService implements ITestService {
              @Override
              @Asynchronous
              public Future<TestDTO> doAsync(TestDTO dto){
                  return new AsyncResult<TestDTO>(execute(dto));
              }
            
            
              public TestDTO execute(TestDTO dto) {
                    dto.setResult("OK")
                return dto;
              }
            }
            
            @Remote
            public interface ITestService extends Serializable{
                  public Future<TestDTO> doAsync(TestDTO dto);
            }
            

             

             

            App A has:

             

            private SomeObjectResult doProcess(OtherRequest req)  {
            
                 ITestService service = getTestService("test", "beanName");
                 Future<TestDTO> future =  null;
                 future = service.doAsync(new TestDTO());
                 TestDTO result;
                 try {
                      result = future.get(20,TimeUnit.SECONDS);
                 } catch (InterruptedException | ExecutionException | TimeoutException e) {
                 }
            return result;
            }
            
            private ITestService getTestService(String moduleName, String beanName) {
              try{
                 Hashtable<String, String> jndiProperties = new Hashtable<String, String>();
                   jndiProperties.put(Context.URL_PKG_PREFIXES, URL_PKG_PREFIXES);
            
                 Context context = new InitialContext(jndiProperties);
            
                 String appName = "";
                 String distinctName = "";
            
                 // remote view fully qualified class name
                 String viewClassName = ITestService.class.getCanonicalName();
                 StringBuilder lookupValue = new StringBuilder();
                 lookupValue.append("ejb:");
                 lookupValue.append(appName);
                 lookupValue.append("/");
                 lookupValue.append(moduleName);
                 lookupValue.append("/");
                 lookupValue.append(distinctName);
                 lookupValue.append("/");
                 lookupValue.append(beanName);
                 lookupValue.append("!");
                 lookupValue.append(viewClassName);
                 return (ITestService) context.lookup(lookupValue.toString());
             }catch(Exception e){
             }
            }
            

             

            The doProcess method is invoked when a web service is called.

            Now happens in a test environment, the files created in this object store don't get accumulated, but I'm worried for the high disk usage.

             

            Thanks