1 Reply Latest reply on Jan 6, 2010 11:45 AM by Ramesh Reddy

    CPU Usage

    Romain GROS Newbie

      We are embedding the TEIID server in one of our bundle on OSGI in order to request a Virtual Database previously created on TEIID designer.

      That means one of our class extends EmbeddedConnectionFactoryImpl and is called by the Activator.
      In this class, we only have two methods :
          public void start() throws MetaMatrixCoreException

          public void stop(boolean restart)
              if (isAlive())
      If we start then stop the TEIID server, it works fine.
      But if we start, then deploying / undeploying a VDB via the AdminShell, finally stopping the TEIID server, the CPU is still used indefinitely.

      Is it a step missing for stopping the TEIID engine ?

      Thanking you in advance
        • 1. Re: CPU Usage
          Ramesh Reddy Master



          You can probably produce a thread dump see what is going on, or run the process in the debug mode. With information provided it is very hard to guess. Using AdminShell is similar to using a Admin API, may be you can write a unit test to re-produce this behavior?


          One another thing that really concerns me is that the pattern in which you are integrating Teiid into OSGI bundle. The "EmbeddedConnectionFactory" level integration is not publicly supported API, thus subject to change at any time in next versions (7.0). The safe bet is to use public APIs, like JDBC interface and Admin API, where Teiid team will suggest alternatives for migration paths if there are any changes to public API.


          What I am trying to say is, wrap your OSGI bundle around Teiid JDBC Driver, once you make the first connection Teiid (either server mode, or embedded mode) will be up and running, then control the lifecyle with Admin API. See Designer's code to see how we used this same technique. What we found difficult in our development is that, Teiid uses lot of reflection based code, OSGI bundles with their classloading mechnisms it is hard to get it right. So, make your application only depend upon Teiid client driver, and bundle all the rest of the Teiid either in a separate bundle (Teiid embedded) or in external process (Teiid server) it is much easier to manage and upgrade in future.