4 Replies Latest reply on Feb 26, 2013 12:31 AM by 452071

    EBS SDK for Java: connections not closing???

      I'm using the EBS SDK for Java in my ADF application. Based on the documentation, it sounds like I should make the connection to EBS in a PagePhaseListener, I found my inspiration here:

      Access to ICX session cookie with ADF-E-BusinessSuite integration (fndext)

      Here's my problem... I can connect just fine and the session management can pull out the user name and function access just fine... but it's not releasing connections back into the pool. If I set inactive timeout to 0 (no timeout), every time a user connects they cling to the request and don't give it up. Which is odd, because I'm calling wrappedRequest.getConnection().close() as per the documentation... but it's not being released. Huh? What kind of black magic do I have to do to release the connection back into the pool?


      if (pagePhaseEvent.getPhaseId() == Lifecycle.INIT_CONTEXT_ID) {

      EbsSession ebsSession = new EbsSession();
      FacesContext fctx = FacesContext.getCurrentInstance();
      HttpServletRequest request = (HttpServletRequest)fctx.getExternalContext().getRequest();
      HttpServletResponse response = (HttpServletResponse)fctx.getExternalContext().getResponse();

      CookieStatus icxCookieStatus = null;
      Context ctx = new InitialContext();
      DataSource myDS = (DataSource)ctx.lookup("jdbc/OracleEBS-SDK-4-Java");
      Connection ebsConn = myDS.getConnection();
      EBiz instance = new EBiz (ebsConn, fctx.getExternalContext().getInitParameter("EBS_APP_ID"));
      wrappedRequest = new AppsRequestWrapper (request, response, ebsConn, instance);

      // get current session or create a new one as guest
      boolean connectAsGuestIfNoSession = true;
      Session session = wrappedRequest.getAppsSession(connectAsGuestIfNoSession);
      if (session != null) {


      if (pagePhaseEvent.getPhaseId() == Lifecycle.PREPARE_RENDER_ID) {
           if (wrappedRequest != null && wrappedRequest.getConnection() != null) {
                if (!wrappedRequest.getConnection().isClosed())