4 Replies Latest reply on Nov 1, 2013 9:14 AM by Uma Java

    New to Teiid, need help

    Uma Java Newbie

      Hi,

       

      We have a requirement to fetch data from a CRM system into a virtual database. I am doing a POC on Teiid and have few questions.

       

      1. We wanted to run Teiid on EmbededServer so we cannot use JBoss AS. I have created a sample program to connect to CRM system and fetch the data and build / deploy VDB. How ever as soon as the main() method finishes, the program exits. I am not sure what an EmbededServer means here, Is the server running in background? What happend to VDB that was built / deployed? How do I keep EmbededServer running?

       

      2. We are using Teiid 8.5.0 Final version, my requirement is to have EmbededServer run and deploy VDB in remote machine and I can use JDBC to connect to the server and access the data. However, I cannot get this to work. I can connect using JDBC within the same JVM that is running the main() method but not using a different JVM or after the program is terminated.

       

      3. EmbededConfiguration object has setUseDisk() method. When I set this value to true, is the VDB being saved to physical file system? If so I can't seem to find its location.

       

      4. Depending on #3 above, if I can generate VDB to physical file system, can I deploy VDB to tomcat and access it somehow?

       

      5. Is there a simple way for me to deploy Teiid to Tomcat server and access using remote Java clients?

       

      6. We wanted to build VDB once and refresh it once every 24 Hrs, what is the right approach here?

       

      Sorry for too many questions, I couldn't get answers by googling.

       

      Thanks,

        • 1. Re: New to Teiid, need help
          Ramesh Reddy Master

          Uma,

          1. We wanted to run Teiid on EmbededServer so we cannot use JBoss AS. I have created a sample program to connect to CRM system and fetch the data and build / deploy VDB. How ever as soon as the main() method finishes, the program exits. I am not sure what an EmbededServer means here, Is the server running in background?  How do I keep EmbededServer running?

          EmbeddedServer means you can "embed" in your application, it is designed mainly for in VM user applications. The lifecycle of the server is up to your application to manage, if you want it keep it alive, just stall the main thread in waiting/sleeping like in your main thread.

           

          while (!shutDownRequested) {
            Thread.sleep(1000);
          }
          

           

          What happend to VDB that was built / deployed?

          As long as your application is alive the VDB is memory bound, once the application exists it will be gone. No persistent copy exits. If you want you can create persistent copy before you deploy to Teiid. Note this is just a XML file.

           

          2. We are using Teiid 8.5.0 Final version, my requirement is to have EmbededServer run and deploy VDB in remote machine and I can use JDBC to connect to the server and access the data. However, I cannot get this to work. I can connect using JDBC within the same JVM that is running the main() method but not using a different JVM or after the program is terminated.

          Look at "addTransport(SocketConfiguration)" on the EmbeddedConfiguration object, define the the necessary information to start a remote socket to listen to remote JDBC connection calls.

          3. EmbededConfiguration object has setUseDisk() method. When I set this value to true, is the VDB being saved to physical file system? If so I can't seem to find its location.

           

           

          setUseDisk() is used to save temporary intermediate engine processing buffer contents to disk or not. Allowing to use disk can allow Teiid process much larger results sets. VDB is not part of this, Teiid does not save this, you need to before deployment if you want to keep a copy of.

          4. Depending on #3 above, if I can generate VDB to physical file system, can I deploy VDB to tomcat and access it somehow?

          Sure you can. You need to write facilities in Tomcat such that when it starts up it looks up your VDBs at a location and deploys them for you.

          5. Is there a simple way for me to deploy Teiid to Tomcat server and access using remote Java clients?

          Not unless you write it. You are basically asking all the life-cycle events like easier deployment, saving the deployments, restart, remote connections just properties of a true server, that is what Teiid in JBoss AS provides and much much more. Of course you can write most of it in Tomcat, by the time you finish it it will look much more like what Teiid has.

          6. We wanted to build VDB once and refresh it once every 24 Hrs, what is the right approach here?

          Again this is up to you how you define, you need to undeploy and redefine VDB every 24 hrs if you want, in your application. In the JBoss AS mode, it also offers a administrative API, using which you can programatically remote deploy and undeploy VDBs along with various other options. Check out the Admin API.

          Sorry for too many questions, I couldn't get answers by googling.

          No problem. Thanks for using Teiid.

           

          Based on your questions, you really need a Teiid deployed in JBoss AS. I am not sure what is your ( your company's) resistance to JBoss AS? it is open source, it is free, and fully functional. Would it be more acceptable if I said, it is just Teiid Server and white washed JBoss AS name? More over Redhat even offers a support if you are going to use this in a enterprise in production environment.

           

          HTH

           

          Ramesh..

          • 2. Re: New to Teiid, need help
            Uma Java Newbie

            Hi Ramesh,

             

            Thank you very much for your answers. Very helpful. I tried with addTransport() method and I see that its not part of 8.5.0 release. Any ideas here please?

             

            I don't see a reason why JBoss AS cannot be used either, management wants to stick to Tomcat for some reasons.

             

            Thanks,

            • 3. Re: New to Teiid, need help
              Ramesh Reddy Master

              Looks like that has been added as part of 8.6 work, see [TEIID-2439] jdbc socket transport support in teiid embedded mode - JBoss Issue Tracker

              you can start working with 8.6 Beta1 (coming out today) or apply the changes from above JIRA on 8.5 Teiid and use 8.5.

               

              Ok, as I mentioned the main issue for management is that there is no support offered yet for Embedded Teiid, so no SLAs.

               

              Ramesh..

              • 4. Re: New to Teiid, need help
                Uma Java Newbie

                Thanks again, Ramesh. I will check the link and see if I can add that feature in 8.5.