9 Replies Latest reply on Apr 24, 2014 9:40 AM by rareddy

    How to capture database changes in Teiid

    kavitha_chilla

      Hi

       

      How can we find any database changes in TEIID

        • 1. Re: How to capture database changes in Teiid
          van.halbert

          chilla,

           

          Take a look at CommandLogging  (Logging - Teiid 8.7 - Project Documentation Editor).   At this point is where the   command that is being sent to the data source is logged.      There is also a quick start that demonstrates writing a custom command logger for logging to a data base or for other custom purposes.

           

          Van

          • 2. Re: How to capture database changes in Teiid
            kavitha_chilla

            Van

             

            Thanks alot for the reply but actually what I exactly want to know is I have two different data sources. Through teiid i.e., using views I can successfully insert data into two databases but if I am inserting the data through any other application into one database I want teiid to insert that data in other database is that possibly.If not is there any case of using third party clients with teiid to achieve it.

            • 3. Re: How to capture database changes in Teiid
              rareddy

              Kavitha,

               

              If you can make the other application to send the inserts to Teiid instead of to the database directly then that is a possibility. Otherwise, Teiid has no way of knowing what data has changed. Typically, if the database sends any data change events, it can be trapped and changed into inserts. So, if you think you can install triggers etc in the database and generate those events then, those could be converted to data. Typically this is not suitable for legacy sources .

               

              Oracle sells a solution called golden gate for their Oracle DBMS, I do not know of any open source solution for this.

               

              If you are working with two exactly same databases, then you may want to simply look for data replication solution provided by the database vendor.

               

              Ramesh..

              • 4. Re: How to capture database changes in Teiid
                kavitha_chilla

                Ramesh,

                 

                Thanks for the reply.You mean that we need to send data change events to teiid so that it can be trapped and changed into inserts?

                • 5. Re: How to capture database changes in Teiid
                  rareddy

                  Yes. Once you are sending events, then you can use Fuse kind of projects to convert the event to a SQL call.

                  • 6. Re: How to capture database changes in Teiid
                    kavitha_chilla

                    Ramesh,

                     

                    Thanks for the quick reply.If I send the trigger event to teiid webservice(i.e., insert|updat|delete) then teiid going to take the given params from the trigger event and do the changes to other database, That's it?

                    • 7. Re: How to capture database changes in Teiid
                      rareddy

                      Kavitha,

                       

                      How you send the event, how you convert the event to a SQL based call that can be consumed by Teiid is up to your design, Teiid does not recommend any one way to do it. above are some suggestions. Also, if replication is going to be only for one other database then you can avoid Teiid altogether and send the SQL call directly to the second database. But use of Teiid will provide abstraction to the source, where you can add additional sources or switch out the source later.

                       

                      Note that there are no transactional guarantees with this model, and also you want make sure redundancy in place to deal with error situations to be complete. That is one of reason I was eluding towards a eventing solution with Fuse ESB, were the events can be tracked. I would love to see someone come with generic solution that can be shared with others, that could be you Kavitha!

                       

                      Ramesh..

                      • 8. Re: How to capture database changes in Teiid
                        kavitha_chilla

                        Ramesh,

                         

                         

                        I am getting this error while creating war file with Teiid designer 8.4.

                        An error occurred while creating WAR file, check log for detail

                        java.lang.RuntimeException: File mysql_view_Output.xsd does not exist.

                          at org.teiid.designer.runtime.ui.wizards.webservices.util.DefaultWebArchiveBuilderImpl.generateWsdl(DefaultWebArchiveBuilderImpl.java:725)

                          at org.teiid.designer.runtime.ui.wizards.webservices.util.DefaultWebArchiveBuilderImpl.createWebArchive(DefaultWebArchiveBuilderImpl.java:235)

                          at org.teiid.designer.runtime.ui.wizards.webservices.WarDeploymentInfoDialog.execute(WarDeploymentInfoDialog.java:195)

                          at org.teiid.designer.runtime.ui.wizards.webservices.WarDeploymentInfoDialog$1.run(WarDeploymentInfoDialog.java:150)

                          at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)

                          at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)

                          at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)

                          at org.teiid.designer.runtime.ui.wizards.webservices.WarDeploymentInfoDialog.okPressed(WarDeploymentInfoDialog.java:159)

                          at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:476)

                          at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:628)

                          at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)

                          at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

                          at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)

                          at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)

                          at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)

                          at org.eclipse.jface.window.Window.runEventLoop(Window.java:826)

                          at org.eclipse.jface.window.Window.open(Window.java:802)

                          at org.teiid.designer.runtime.ui.wizards.webservices.WarDeploymentInfoDialog.open(WarDeploymentInfoDialog.java:171)

                          at org.teiid.designer.runtime.ui.actions.GenerateWarAction.run(GenerateWarAction.java:116)

                          at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)

                          at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)

                          at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)

                          at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)

                          at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

                          at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)

                          at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)

                          at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)

                          at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)

                          at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

                          at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)

                          at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)

                          at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)

                          at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

                          at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)

                          at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)

                          at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)

                          at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

                          at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

                          at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

                          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)

                          at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)

                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                          at java.lang.reflect.Method.invoke(Method.java:597)

                          at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)

                          at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)

                          at org.eclipse.equinox.launcher.Main.run(Main.java:1450)

                        • 9. Re: How to capture database changes in Teiid
                          rareddy

                          Kavith,

                           

                          Please open another discussion with full details about versions of the software you are using and JDK etc.

                           

                          Ramesh..