4 Replies Latest reply on May 8, 2012 12:49 PM by 798676

    Documentation of BC4JDataControl tag in DataBindings.cpx

    798676
      Hi,

      Where can I find documentation of BC4JDataControl tag in DataBindings.cpx? Especially, I need to know more about TransactionName attribute. In fact, my main requirement is to share a database connection and transaction between some Application Modules without using nested application modules. I have multiple ViewController projects and multiple Model projects in my application. Each ViewController uses its own Model. I want to make all Application Modules in all Model projects to use the same database connection.

      It seems that using the same TransactionName is a solution, but I need to know its functionality and probably its side effects.

      Thanks,
      Mehdi
        • 1. Re: Documentation of BC4JDataControl tag in DataBindings.cpx
          Chris Muir-Oracle
          Please specify the version of JDeveloper you're using when posting to this forum.

          Some documentation on the DataBindings.cpx file can be found here:
          http://docs.oracle.com/cd/E23943_01/web.1111/b31974/appendixa.htm#CDJBBHIH

          However if you're using 11.1.1.X.0 and you're using task flows read this post:
          http://one-size-doesnt-fit-all.blogspot.com.au/2011/05/jdev-11g-task-flows-adf-bc-one-root.html

          If you're using 11.1.2.X and you're using task flows read these post:
          http://one-size-doesnt-fit-all.blogspot.com.au/2011/07/task-flows-sayonara-automated-nesting.html
          http://one-size-doesnt-fit-all.blogspot.com.au/2011/08/task-flows-sayonara-auto-am-nesting-in.html

          Ensure to read the 2nd post.

          CM.
          • 2. Re: Documentation of BC4JDataControl tag in DataBindings.cpx
            798676
            Dear Chris,

            Thank you very much for your reply. I am sorry for not mentioning the version. I'm using JDev 11.1.1.6.0.

            I had tried task flow transaction options. Although, I didn’t know the background mechanism and your post jdev-11g-task-flows-adf-bc-one-root was very helpful. I have a problem using task flow transaction options. When I use DCJboDataControl.commitTransaction(), everything’s Ok. But if I use ApplicationModule.getTransaction().commit() or postChanges(), only the changes in the current application module are committed. I don’t need to call ApplicationModule.getTransaction().commit(), but postChanges() is something that I need. When I use BC4JDataControl.TransactionName I don’t have this problem. It works well.

            I read the documentation on the DataBindings.cpx file, but it doesn’t mention TransactionName. It seems very useful and someone must know something about it.

            Mehdi Javan
            • 3. Re: Documentation of BC4JDataControl tag in DataBindings.cpx
              Chris Muir-Oracle
              Apologies for the slow reply, I'm currently travelling.

              "When I use DCJboDataControl.commitTransaction(), everything’s Ok. But if I use ApplicationModule.getTransaction().commit() or postChanges(), only the changes in the current application module are committed. I don’t need to call ApplicationModule.getTransaction().commit(), but postChanges() is something that I need."

              This confuses me. Are you calling this code from your ViewController level? This is not the standard way to commit from the ViewController layer. You should be accessing this code through the binding layer..... maybe I've misunderstood why you're calling this code directly?

              However I still believe you should be looking at the task flow transaction options here. These were specifically designed to commit/rollback multiple data controls (such as multiple root Application Module data controls) in a group.

              In order to do this from the context of a task flow within the ViewController, if your task flow is part of a task flow transaction (controlled by an internal class known as the DataControlFrame), to commit/rollback the task flow transaction you can either use the task-flow-return "commit" activity or programatically call the DataControlFrame commit() method.

              The following section of the ADF Fusion Dev Guide gives more information on the task flow transaction options: http://docs.oracle.com/cd/E23943_01/web.1111/b31974/toc.htm#

              Ensure to research this and the data control scope options of the task flow.

              In terms of calling the task flow/data control frame operations programmatically, a utility class entitled TaskFlowUtils.java is available here: http://java.net/projects/adfemg/downloads

              Please note the class has no implied warranty, use at your own risk.

              CM.
              • 4. Re: Documentation of BC4JDataControl tag in DataBindings.cpx
                798676
                You don't need to apologize. In fact, I appreciate your help a lot.

                We use postChanges() in Model layer. In some cases we need to force the framework to apply some DML instructions before we execute a query using executeQuery method of a ReadOnly ViewObject, because the DMLs affect the result of the ViewObject. Such code is written in methods of ApplicationModules which are called from ViewController. By mentioning ApplicationModule.getTransaction().commit() I tried to make my problem more clear. As you said we commit the transaction through binding layer.

                I'll follow the links you mentioned. Although, I'm really curious about BC4JDataControl.TransactionName ;)
                I'll post the result.

                Thank you very much.
                Mehdi Javan