ApplicationModule.getTransaction().postChanges()

Hi to all;
Does not exists an entity by entity option to post changes , before sending an commit ?
Best regards;
Marcos Ortega
Brazil

Hi,
If you go to the EntityImpl class of your Entity, open it and choose "Source --> Override Methods" from the menu, you can create a beforeCommit(), afterCommit() ... method that allows you to control this behavior.
Frank

Similar Messages

  • How can I see changes in table with insertrow();postchanges()without commit

    Hi friends;
    I use jdeveloper 10.1.3.1 with jheadstart 10.1.3.1.
    I create two view object.In the first page I create table with one view object.
    In the second page I create table (with tableselectmany) with other view.
    I select many rows in second page and in the managed bean,
    I insert selectted rows atributes to first pages tables attributes.
    I use this code.
    public String commandbuttonaction(){
    CoreTable table = this.getTable1();
    Set rowSet = table.getSelectionState().getKeySet();
    Iterator rowSetIter = rowSet.iterator();
    BindingContainer bindings = getBindings();
    DCIteratorBinding pr_dcib = (DCIteratorBinding)
    bindings.get("DeptIterator");
    int i=206;
    while (rowSetIter.hasNext()){
    Key key = (Key) rowSetIter.next();
    pr_dcib.setCurrentRowWithKey(key.toStringFormat(true));
    RowImpl prRow = (RowImpl) pr_dcib.getCurrentRow();
    String AM="model.AppModule";
    String CF="AppModuleLocal";
    ApplicationModule empSvc = Configuration.createRootApplicationModule(AM, CF);
    ViewObject emps = empSvc.findViewObject("EmpsView1");
    Row newEmp = emps.createRow();
    newEmp.setAttribute("Manager",new Number(1));
    newEmp.setAttribute("Department",new Number(1));
    newEmp.setAttribute("Depno",new Number(3));
    emps.insertRow(newEmp);
    try {
    newEmp.validate();
    catch (Exception ex) {
    System.out.println("validate catch");
    try {
    empSvc.getTransaction().postChanges();
    catch (Exception ex) {
    System.out.println("post catch");
    Configuration.releaseRootApplicationModule(empSvc,true);
    i=i+1;
    In this code I only postchanges() in first view and dont want to commit.
    But I cant see changes row in the page .If I press save I see transaction completed succesfully message.
    But in database not insertted any rows.
    If I write commit() after postchanges() code I see rows in the table .But I dont want to commit.Only post
    my changes and if necessary I press save button in page.
    How can I see changes in the page without commit???Thanks for all....

    You should NEVER use statements like this in managed beans:
    ApplicationModule empSvc = Configuration.createRootApplicationModule(AM, CF);
    This will create a separate application module instance, not shared by the the web pages. That's why you do not see the changes.
    Instead, you can use the following code:
    ApplicationModule am = (ApplicationModule)JsfUtils.getExpressionValue("#{data.MyAppModuleDataControl.dataProvider}");
    where MyAppModuleDataControl shoud be replaced with the name of your am data control.
    Steven Davelaar,
    JHeadstart Team.

  • GetTransaction().validate();  - what happens if the Insert fails?

    Hi forum members,
    I am rookie in terms of development with ADF/Jdeveloper and I've got an error which I've traced to the following piece of code
    am.getTransaction().validate();
    am.getTransaction().postChanges();
    DBSequence newAdId = (DBSequence)newAssociatedDocument.getAttribute("AdId");
    int adId = newAdId.getSequenceNumber().intValue();
    return adId;
    "am" as you'd guess is an ApplicationModule
    The return value of "adId" is -1.
    The "ADID" in the database is controlled by a Pre-Insert Database trigger which fills it with a Primary Key value.
    Now, it sounds like the Insert of the Row fails somewhere and hence the "adID" is -1 as I've read that in Metalink. Like, DBSequence initially populates it with "-1" and then fills it (if the transaction is successful) with the actual ADID value that was inserted into the database (behind the scenes using the RETURNING INTO clause).
    But my question is How to Trap the Oracle Database Error that happens behind the scenes? Like it looks like the postChanges() is actually successful (no Exception raised, else it would have been cascaded back) and we actually get a "-1" returned to the Caller.
    Would I be able to do an Oracle Trace and detect the Oracle error?
    Thanks
    Ravi

    It is very important to backup your iPad before you prceed with update.
    Backup and Restore
    http://support.apple.com/kb/ht1766

  • PostChanges()  commit the data into MySQL with engine=MyISAM

    suddenly i found the following code called in AM could commit the change into database .
    this.getTransaction().postChanges();
    My database is MySQL 5.0,and set it with MyISAM engine .i know this engine can not support transaction.

    Hi,
    In the same step 4, please try the option pure SQL and enter the query, "select count(*) from tablename"
    Please check whether this is working fine ? And also, were you able to see the records in the JDeveloper IDE with the connecting to the MySQL Database...
    And aslo, the data source you have created for accessing the mySQL Database in weblogic console, what username credentials have you given ? please check whether that username has privileges to the table you want to select ? And , the table you are selecting is under the same username schema or another schema ? If it is a different schema , then find out whether the username you have given while creating the data source has read/write privileges to that table ?
    Thanks,
    N

  • JBO-25014 & postChanges()

    We are using JDeveloper 10.1.3.3 and ADF.
    We have a master & detail association, and we add one row to the master and one row to the detail in one commandButton_action() of the backing-bean of our jspx page.
    This commandButton sends the application to another jspx page where we have the master & detail table
    In the first page we need to call the method AModule.getTransaction().postChanges(), otherwise the jspx only show the master row, no the detail row.
    The problem is that when we try to do commit() we get the JBO-25014 error.
    What can we do to solve this problem.
    Thanks.

    Hi,
    check http://radio.weblogs.com/0118231/stories/2004/03/24/whyDoIGetOraclejborowinconsistentexception.html
    Frank

  • DoDML() not called at postChanges?

    Hi there,
    i have an entity object, which retieves some key attributes (like PK) via stored procedure in the entities doDML-method. Since i need these attributes in viewobjects linked by these attributes, i need to retrieve these aatribute in the same transaction. So i called appModule.getTransaction().postChanges() to send the data to the database and retrieve the key attributes.
    But the doDML-method is not called! So how can i get informations from db db?
    Please help!

    The DBSequence feature also automatically handles the PK and FK mandatory problem. Have you tried it? :-)
    doDML() should definitely be called during postChanges(), but if an error is thrown first about a mandatory attribute's not being filled in, then you won't be ever getting to the doDML().
    Could you possibly have overridden a doDML() method with the wrong signature? (so it would be not treated as an overridden method)?
    Assuming your parent and child entities are Dept and Emp, are you trying to populate the primary key for Dept EO in an overridden doDML() method on Dept EO and then trying to populate the Emp foreign key attribute to Dept based on this value?
    Again, using DBSequence, the temporary (negative) PK for the Dept would get allocated for you, you can use the temporary negative PK
    I've posted a working example of a Dept/Emp based project wherein the DeptImpl entity overrides doDML() and provides a programatically-assigned "actual" value for the DBSequence (instead of the simpler way of populating it in a trigger and letting BC4J totally automate this job for you).
    http://www.geocities.com/smuench/PKFromStoredProc.zip
    In my example my code hard-codes the new Deptno to 46, but you could replace that with any programatic technique to determine the Id's "real" value at commit time, including a call to your stored procedure.
    I'm still not understanding if your doDML() is on

  • HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean

    HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean
    by Steve Muench
    Overview
    BC4J provides automatic facilities for deploying any application module as a stateful EJB session bean. If you want to leverage the features of your BC4J application module from a stateless EJB session bean, it's not automatic but it is straightforward to implement. This howto article explains the details.
    For our example, we will create a stateless EJB session bean that uses a container-managed transaction. To keep things simple, let's assume the session bean has a single public method on its remote interface named createDepartment() with the following signature:
    public void createDepartment(int id, String name, String loc) throws AppException
    AppException is an example of an application-specific exception that our method will throw if any problems arise during its execution.The goal of this article is to illustrate how to use the BC4J application module named com.example.hr.HRApp as part of the implementation of this createDepartment method on our stateless enterprise bean. Let's assume that the HRApp application module has a view object member named Departments, based on the com.example.hr.DeptView view object, based on the familiar DEPT table and related to the com.example.hr.Dept entity object so our view can be updateable.
    Creating the Stateless Session Bean
    We can start by using the JDeveloper Enterprise Bean wizard to create a new stateless session bean called StatelessSampleEJB implemented by:[list][*]com.example.StatelessSampleEJBBean (Bean class)[*]com.example.StatelessSampleEJBHome (Home interface)[*]com.example.StatelessSampleEJB (Remote interface)[list]
    We then use the EJB Class Editor to add the createDepartment method to the remote interface of StatelessSampleEJB with the signature above. We edit the remote interface to make sure that it also reflects that the createDepartment method thows the AppException like this:
    package com.example;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface StatelessSampleEJB extends EJBObject {
      void createDepartment(int id, String name, String loc)
      throws RemoteException,AppException;
    }Before we start adding BC4J into the picture for our implementation, our StatelessSampleEJBBean class looks like this:
    package com.example;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class StatelessSampleEJBBean implements SessionBean {
      public void ejbCreate(){}
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){
      public void createDepartment(int id, String name, String loc) 
      throws AppException {
        // TODO: Implement method here
    }We can double-click on the ejb-jar.xml file in our project to see the XML deployment descriptor for the bean we just created:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
    </ejb-jar>We need to add the extra <assembly-descriptor> section in this file to indicate that the createDepartment method will require a transaction. After this edit, the ejb-jar.xml file looks like this:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
       <assembly-descriptor>
          <container-transaction>
             <method>
                <ejb-name>StatelessSampleEJB</ejb-name>
                <method-name>createDepartment</method-name>
                <method-params>
                   <method-param>int</method-param>
                   <method-param>java.lang.String</method-param>
                   <method-param>java.lang.String</method-param>
                </method-params>
             </method>
             <trans-attribute>Required</trans-attribute>
          </container-transaction>
       </assembly-descriptor>
    </ejb-jar>
    Aggregating a BC4J Application Module
    With the EJB aspects of our bean setup, we can proceed to implementing the BC4J application module aggregation.
    The first thing we do is add private variables to hold the EJB SessionContext and the instance of the aggregated BC4J ApplicationModule, like this:
    // Place to hold onto the aggregated appmodule instance
    transient private ApplicationModule _am  = null;
    // Remember the SessionContext that the EJB container provides us
    private           SessionContext    _ctx = null;and we modify the default, empty implementation of the setSessionContext() method to remember the session context like this:
    public void setSessionContext(SessionContext ctx){ _ctx = ctx; }We add additional constants that hold the names of the J2EE datasource that we want BC4J to use, as well as the fully-qualified name of the BC4J application module that we'll be aggregating:
    // JNDI resource name for the J2EE datasource to use
    private static final String DATASOURCE = "jdbc/OracleCoreDS";
    // Fully-qualified BC4J application module name to aggregate
    private static final String APPMODNAME = "com.example.hr.HRApp";We expand the now-empty ejbCreate() and ejbRemove() methods to create and destory the aggregated instance of the BC4J application module that we'll use for the lifetime of the stateless session bean. When we're done, ejbCreate() it looks like this:
    public void ejbCreate() throws CreateException {
      try {
        // Setup a hashtable of environment parameters for JNDI initial context
        Hashtable env = new Hashtable();
        env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
        // NOTE: we want to use the BC4J app module in local mode as a simple Java class!
        env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
        env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
        // Create an initial context, using this hashtable of environment params
        InitialContext ic = new InitialContext(env);
        // Lookup a home interface for the application module
        ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
        // Using the home, create the instance of the appmodule we'll use
        _am = home.create();
        // Register the BC4J factory to handle EJB container-managed transactions
        registerContainerManagedTransactionHandlerFactory();
      catch(Exception ex) {
         ex.printStackTrace();
        throw new CreateException(ex.getMessage());
    }and ejbRemove() looks like this:
    public void ejbRemove() {
      try {
        // Cleanup any appmodule resources before getting shutdown
        _am.remove();
      catch(JboException ex) { /* Ignore */ }
    }The helper method named reigsterContainerManagedTransactionHandlerFactory() looks like this:
    private void registerContainerManagedTransactionHandlerFactory() {
      SessionImpl session = (SessionImpl)_am.getSession();
      session.setTransactionHandlerFactory(
        new TransactionHandlerFactory() {
          public TransactionHandler  createTransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
          public JTATransactionHandler createJTATransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
    }The last detail is to use the BC4J appmodule to implement the createDepartment() method. It ends up looking like this:
    public void createDepartment(int id, String name, String loc)
    throws AppException {
      try {
        // Connect the AM to the datasource we want to use for the duration
        // of this single method call.
        _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
        // Use the "Departments" view object member of this AM
        ViewObject departments = _am.findViewObject("Departments");
        // Create a new row in this view object.
        Row newDept = departments.createRow();
        // Populate the attributes from the parameter arguments.
        newDept.setAttribute("Deptno", new Number(id));
        newDept.setAttribute("Dname", name);
        newDept.setAttribute("Loc", loc);
        // Add the new row to the view object's default rowset
        departments.insertRow(newDept);
        // Post all changes in the AM, but we don't commit them. The EJB
        // container managed transaction handles the commit.
        _am.getTransaction().postChanges();
      catch(JboException ex) {
        // To be good EJB Container-Managed Transaction "citizens" we have
        // to mark the transaction as needing a rollback if there are problems
        _ctx.setRollbackOnly();
        throw new AppException("Error creating dept "+ id +"\n"+ex.getMessage());
      finally {
        try {
          // Disconnect the AM from the datasource we're using
          _am.getTransaction().disconnect();
        catch(Exception ex) { /* Ignore */ }
    Building a Test Client
    With the EJB-Tier work done, we can build a sample client program to test this new stateless EJB Session Bean by selecting the bean in the Oracle9i JDeveloper IDE and choosing "Create Sample Java Client" from the right-mouse menu.
    When the "Sample EJB Client Details" dialog appears, we take the defaults of connecting to embedded OC4J container. Clicking the (OK) button generates the following test class:
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import com.example.StatelessSampleEJB;
    import com.example.StatelessSampleEJBHome;
    public class SampleStatelessSampleEJBClient {
      public static void main(String [] args) {
        SampleStatelessSampleEJBClient sampleStatelessSampleEJBClient =
           new SampleStatelessSampleEJBClient();
        try {
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY,
                  "com.evermind.server.rmi.RMIInitialContextFactory");
          env.put(Context.SECURITY_PRINCIPAL, "admin");
          env.put(Context.SECURITY_CREDENTIALS, "welcome");
          env.put(Context.PROVIDER_URL,
                  "ormi://localhost:23891/current-workspace-app");
          Context ctx = new InitialContext(env);
          StatelessSampleEJBHome statelessSampleEJBHome =
               (StatelessSampleEJBHome)ctx.lookup("StatelessSampleEJB");
          StatelessSampleEJB statelessSampleEJB;
          // Use one of the create() methods below to create a new instance
          // statelessSampleEJB = statelessSampleEJBHome.create();
          // Call any of the Remote methods below to access the EJB
          // statelessSampleEJB.createDepartment( int id, java.lang.String name, java.lang.String loc );
        catch(Throwable ex) {
          ex.printStackTrace();
    }We uncomment the call to the create() method and add a few calls to the createDepartment() method so that the body of the test program now looks like this:
    // Use one of the create() methods below to create a new instance
    statelessSampleEJB = statelessSampleEJBHome.create();
    // Call any of the Remote methods below to access the EJB
    statelessSampleEJB.createDepartment( 13, "Test1","Loc1");
    System.out.println("Created department 13");
    statelessSampleEJB.createDepartment( 14, "Test2","Loc2");
    System.out.println("Created department 14");
    try {
      // Try setting a department id that is too large!
      statelessSampleEJB.createDepartment( 23456, "Test3","Loc3");
    catch (AppException ax) {
      System.err.println("AppException: "+ax.getMessage());
    }Before we can successfully run our SampleStatelessSampleEJBClient we need to first run the EJB bean that the client will try to connect to. Since Oracle9i JDeveloper supports local running and debugging of the EJB-Tier without doing through a full J2EE deployment step, to accomplish this prerequisite step we just need to right-mouse on the StatelessSampleEJB node in the System Navigator and select "Run". This starts up the embedded OC4J instance and runs the EJB right out of the current out path.Finally, we can run the SampleStatelessSampleEJBClient, and see the output of the test program in the JDeveloper log window:
    Created department 13
    Created department 14
    AppException: Error creating dept 23456
    JBO-27010: Attribute set with value 23456 for Deptno in Dept has invalid precision/scale
    Troubleshooting
    One error that might arise while running the example is that the database connection information in your data-sources.xml for the jdbc/OracleCoreDS datasource does not correspond to the database you are trying to test against. If this happens, then double-check the file .\jdev\system\oc4j-config\data-sources.xml under the JDeveloper installation home directory to make sure that the url value provided is what you expect. For example, to work against a local Oracle database running on your current machine, listening on port 1521, with SID of ORCL, you would edit this file to have an entry like this for jdbc/OracleCoreDS :
    <data-source
        class="com.evermind.sql.DriverManagerDataSource"
        name="OracleDS"
        location="jdbc/OracleCoreDS"
        xa-location="jdbc/xa/OracleXADS"
        ejb-location="jdbc/OracleDS"
        connection-driver="oracle.jdbc.driver.OracleDriver"
        username="scott"
        password="tiger"
        url="jdbc:oracle:thin:@localhost:1521:ORCL"
        inactivity-timeout="30"
    />This is the data-sources.xml file that gets used by the embedded OC4J instance running in JDeveloper.
    Conclusion
    Hopefully this article has illustrated that it is straightforward to utilize the full power of BC4J in local mode as part of your EJB Stateless Session Beans using container-managed transaction. This example illustrated a single createDepartment method in the enterprise bean, but by replicating the application module interaction code that we've illustrated in createDepartment, any number of methods in your stateless session bean can use the aggregated application module instance created in the ejbCreate() method.
    Code Listing
    The full code listing for the SampleStatelessEJB bean implementation class looks like this:
    * StatelessSampleEJB
    * Illustrates how to use an aggregated BC4J application module
    * in local mode as part of the implementation of a stateless
    * EJB session bean using container-managed transaction.
    * HISTORY
    * smuench/dmutreja 14-FEB-2002 Created
    package com.example;
    import oracle.jbo.*;
    import oracle.jbo.server.*;
    import javax.ejb.*;
    import oracle.jbo.domain.Number;
    import oracle.jbo.common.PropertyConstants;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    import oracle.jbo.server.ejb.ContainerManagedTxnHandlerImpl;
    public class StatelessSampleEJBBean implements SessionBean {
      // JNDI resource name for the J2EE datasource to use
      private static final String DATASOURCE = "jdbc/OracleCoreDS";
      // Fully-qualified BC4J application module name to aggregate
      private static final String APPMODNAME = "com.example.hr.HRApp";
      // Place to hold onto the aggregated appmodule instance
      transient private ApplicationModule _am  = null;
      // Remember the SessionContext that the EJB container provides us
      private           SessionContext    _ctx = null;
      public void ejbCreate() throws CreateException {
        try {
          // Setup a hashtable of environment parameters for JNDI initial context
          Hashtable env = new Hashtable();
          env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
          env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
          env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
          // Create an initial context, using this hashtable of environment params
          InitialContext ic = new InitialContext(env);
          // Lookup a home interface for the application module
          ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
          // Using the home, create the instance of the appmodule we'll use
          _am = home.create();
          // Register the BC4J factory to handle EJB container-managed transactions
          registerContainerManagedTransactionHandlerFactory();
        catch(Exception ex) {
           ex.printStackTrace();
          throw new CreateException(ex.getMessage());
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){ _ctx = ctx; }
      public void createDepartment(int id, String name, String loc)
      throws AppException {
        try {
          // Connect the AM to the datasource we want to use for the duration
          // of this single method call.
          _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
          // Use the "Departments" view object member of this AM
          ViewObject departments = _am.findViewObject("Departments");
          // Create a new row in this view object.
          Row newDept = departments.createRow();
          // Populate the attributes from the parameter arguments.
          newDept.setAttribute("Deptno", new Number(id));
          newDept.setAttribute("Dname", name);
          newDept.setAttribute("Loc", loc);
          // Add the new row to the view object's default rowset
          departments.insertRow(newDept);
          // Post all changes in the AM, but we don't commit them. The EJB
          // container managed transaction handles the commit.
          _am.getTransaction().postChanges();
        catch(JboException ex) {
          // To be good EJB Container-Managed Transaction "citizens" we have
          // to mark the transaction as needing a rollback if there are problems
          _ctx.setRollbackOnly();
          throw new AppException("Error creating dept "+ id +\n"+ex.getMessage());
        finally {
          try {
            // Disconnect the AM from the datasource we're using
            _am.getTransaction().disconnect();
          catch(Exception ex) { /* Ignore */ }
      private void registerContainerManagedTransactionHandlerFactory() {
        SessionImpl session = (SessionImpl)_am.getSession();
        session.setTransactionHandlerFactory(
          new TransactionHandlerFactory() {
            public TransactionHandler createTransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();
            public JTATransactionHandler createJTATransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();

    Hi Steve, It4s me again;
    About the question I made, I tried with a single assembly-descriptor tag and a single container-transaction tag in the deployment descriptor of the session bean and these were the results.
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Then I tried with multiple assembly-descriptor tags each with a single container-transaction tag and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Finally I tried with a single assembly-descriptor and multiple container tags and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    How can I make my Stateless Session bean work out?

  • OC4J error when posting changes - Help needed

    When i call postChanges() and later Commit() to the ApplicationModule's transaction I succed.
    The next time i call postChanges() on the ApplicationModule's transaction the following exception is thrown on the OC4J server:
    oracle.jbo.DMLException: JBO-26080: Error while selecting entity for Styles
    at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelect(OracleSQLBuilderImpl.java:841)
    at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:3839)
    at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:2630)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.lock(StylesImpl.java:635)
    at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:1848)
    at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:1790)
    at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:1570)
    at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:754)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.setStyleName(StylesImpl.java:152)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.setAttrInvokeAccessor(StylesImpl.java:446)
    at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:680)
    at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:903)
    at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:819)
    at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:948)
    at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:925)
    at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:717)
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.updateRow(RuntimeViewRowSetIteratorInfo.java:311)
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.readPiggyback(RuntimeViewRowSetIteratorInfo.java:193)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readPiggyback(AbstractRemoteApplicationModuleImpl.java:2419)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.isTransactionDirty(AbstractRemoteApplicationModuleImpl.java:1788)
    at oracle.jbo.server.remote.ejb.EJBApplicationModuleImpl.riIsTransactionDirty(EJBApplicationModuleImpl.java:2454)
    at RemoteStylecardModule_StatefulSessionBeanWrapper6.riIsTransactionDirty(RemoteStylecardModule_StatefulSessionBeanWrapper6.java:12889)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:80)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01002: Fetch out of sequence
    Is there a solution to this problem?
    Client sample code:
    import javax.naming.*;
    import java.util.Hashtable;
    import oracle.jbo.*;
    //import oracle.job.client.*;
    ** Sample client code for connecting to an appmdoule deployed
    ** as an EJB session bean to Oracle9iAS server.
    public class SampleEJBClient
    public static void main(String[] args)
    ** Change the following String's to match your appmodule name and the
    ** name of the viewobject included in that appmodule.
    String amDefName = "dk.bestseller.bestinfoII.purchase.stylecard.StylecardModule";
    String voMemberName = "StylesView";
    ** Change the following to match the name of the J2EE application
    ** containing the deployed appmodule session bean.
    String applicationName = "BCStyleCardEJB";
    ** Change the following to point to the datasource name
    ** (defined in Oracle9iAS).
    ** to your database.
    String dataSourceName = "jdbc/BI2DS";
    ** Change the following to point to the hostname where the
    ** appmodule is deployed i.e. the host where Oracle9iAS application
    ** server is running.
    String applicationServerHost = "bsdk-bi2app2";
    ** Change the following username and password
    ** to be used for connecting to the Oracle9iAS server.
    String iasUserName = "****";
    String iasUserPasswd = "****";
    ApplicationModule am = null;
    try
    // Setup JNDI environment for looking up
    // the appmodule
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_EJB_IAS);
    env.put(JboContext.HOST_NAME, applicationServerHost);
    env.put(JboContext.SECURITY_PRINCIPAL, iasUserName);
    env.put(JboContext.SECURITY_CREDENTIALS, iasUserPasswd);
    env.put(JboContext.APPLICATION_PATH, applicationName);
    Context ctx = new InitialContext(env);
    // Lookup appmodule home
    ApplicationModuleHome amHome = (ApplicationModuleHome)ctx.lookup(amDefName);
    // Create an appmodule instance
    am = amHome.create();
    // Connect to the database using the datasource
    am.getTransaction().connectToDataSource(null, dataSourceName, false);
    // Find the viewobject included in the appmodule
    ViewObject vo = am.findViewObject(voMemberName);
    // Iterate over the viewobject to get the rows
    long l = System.currentTimeMillis();
    Row r = vo.first();
    r.setAttribute("StyleName", "My Change 1");
    am.getTransaction().postChanges();
    am.getTransaction().commit();
    r.setAttribute("StyleName", "My Change 2");
    //Here the exception is thrown when i call postChanges()
    am.getTransaction().postChanges();
    am.getTransaction().commit();
    System.out.println("vo.first(): "+(System.currentTimeMillis()-l));
    while (r != null)
    l = System.currentTimeMillis();
    // Iterate over the current row and get
    // all the attributes
    for (int i = 0; i < vo.getAttributeCount(); i++)
    String attrName = vo.getAttributeDef(i).getName();
    String attrVal = r.getAttribute(i).toString();
    System.out.println(attrName + " = " + attrVal);
    System.out.println("Row: "+(System.currentTimeMillis()-l));
    l = System.currentTimeMillis();
    r = vo.next();
    catch (NamingException ex)
    System.out.println("NamingException " + ex.getMessage());
    ex.printStackTrace();
    catch (ApplicationModuleCreateException ex)
    System.out.println("Unable to create application module: " + ex.getMessage());
    ex.printStackTrace();
    catch (JboException ex)
    System.out.println("JboException: " + ex.getMessage());
    ex.printStackTrace();
    catch (Exception ex)
    System.out.println("Exception: " + ex.getMessage());
    ex.printStackTrace();
    finally
    if (am != null)
    am.getTransaction().disconnect();
    am.remove();
    }

    I have inserted a rollback() just after the commit() that soules the problem.
    ViewObject vo = am.findViewObject(voMemberName);
    // Iterate over the viewobject to get the rows
    long l = System.currentTimeMillis();
    Row r = vo.first();
    r.setAttribute("StyleName", "My Change 1");
    am.getTransaction().postChanges();
    am.getTransaction().commit();
    //with out this line the server throws the exception (Is it a bug?)
    am.getTransaction().rollback();
    vo = am.findViewObject(voMemberName);
    r = vo.first();
    r.setAttribute("StyleName", "My Change 2");
    am.getTransaction().postChanges();
    am.getTransaction().commit();

  • Oracle ADF: Cannot Commit Database Transaction

    Hi All
    I am trying to update oracle database using Oracle ADF from command line. The following is my code snippet
      final String amName1 = "taxreturn.AM_Taxreturn";
      final String connStr = "jdbc:oracle:thin:o9ias/[email protected]:1521:t1fdbo";
      Hashtable env = new Hashtable(2);
      env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
      env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
      ApplicationModule appMod1 = null;
    try {
       javax.naming.Context ic = new InitialContext(env);
      ApplicationModuleHome home1 = (ApplicationModuleHome)ic.lookup(amName1);
      appMod1 = home1.create();
      appMod1.getTransaction().connect(connStr);
    } catch (Exception e) {
        e.printStackTrace();
      ViewObject t1xvVO = appMod1.createViewObject("t1xvVO", "taxreturn.T1XrefVView");
      t1xvVO.setWhereClause("T1X_T1FU_USERID='" + "testlin2" + "' and T1X_T1_TAXYEAR='" + "2012" + "' and T1X_DELETED is null and T1X_INVOICE_T1_150 is null");
      t1xvVO.executeQuery();
    Row rowT1xv = null;
    int count = 0;
    while (t1xvVO.hasNext()) {
    count++;
    rowT1xv = t1xvVO.next();
    System.out.println("Number of records: " + count);
    t1xvVO.executeQuery();
    if (t1xvVO.hasNext()) {
        rowT1xv = t1xvVO.last();
        System.out.println("First Name: " + rowT1xv.getAttribute("T1FirstName"));
        System.out.println("T1xInvoiceT1150: Before: " + rowT1xv.getAttribute("T1xInvoiceT1150"));
        rowT1xv.setAttribute("T1xInvoiceT1150", "250");
        //appMod1.getTransaction().postChanges();
        System.out.println("T1xInvoiceT1150: After: " + rowT1xv.getAttribute("T1xInvoiceT1150"));
    System.out.println("Is Dirty: " + t1xvVO.getApplicationModule().getTransaction().isDirty());
    try {
        appMod1.getTransaction().commit();
        System.out.println("Commit succeeded.");
    } catch (oracle.jbo.JboException e) {
        System.out.println("Commit failed. " + e);
    I can see there are total 3 records retrieved. Then I execute query for the view object again and change the last record. But after the commit statement, the database is not update. What's wrong here? Thanks in advance
    Leaf

    Refer 6.4.9 How to Create a New Row for a View Object Instance
    http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bcqueryresults.htm#sm0094
    The procedure to create an ApplicationModule and find View object is different than in the code snippet. Use the procedure in the link.

  • Transaction Management -  App Module in Stateless Session Bean

    Hi All,
    We are using Application Module in local mode in a Stateless Session Bean. The application module gets the database connection from the datasource of the application server(Oracle 9iAS).
    The problem that we are facing is as follows
    - When a database update/insert is made using the Application Module and the ViewObject (and the underlying Entity Object), the changes are not being commited.
    Please note that we are not using the ApplicationModule.getTransaction.commit() as it does not give us commit/rollback control from another Session Bean/UseCase. We instead are relying on the Container to manager the transaction and commit the database changes. But the container does not seem to refresh the changes to the database.
    Q1 - Is there a contract between the container and the application module that needs to be created so that the container managed-transaction and the application module work together ?
    Any help in this matter would be greatly appreciated.
    -Ankur Sinha

    Q1 - Is there a contract between the container and the application module that needs to be created so that the container managed-transaction and the application module work together ?For stateless beans you have to call postChanges in the business method for the changes to be applied to the db. For stateful beans bc4j we do that automatically just before the transaction ends.
    Take a look at the following howto
    http://otn.oracle.com/products/jdev/howtos/bc4j/ejbstateless_with_bc4j.html
    In 9.0.3 you'll be able to create a stateless service bean declaritively.
    dhiraj Hi dhiraj,
    - I looked at the example but was not able to find the ContainerManagedTxnHandlerImpl class in the BC4J jars. Can you point me to the latest version of BC4J on technet ?. I already have JDeveloper 9.0.2
    - Regarding your response, what do you mean by creating stateless service bean declaritively ?
    Thanks,
    Ankur

  • JClient Binary File Upload and Insert

    We are looking for ways to upload and insert a pdf or other binary file into a view object using JClient on the client tier. Can anyone point us to sample code for this?

    this should do this
    ApplicationModule appmod = panelBinding.getApplicationModule();
    JUApplication app = panelBinding.getApplication();
    ViewObject vo_calldoc = appmod.findViewObject("CallDocsView1");
    Row newdoc = vo_calldoc.createRow();
    newdoc.setAttribute("CdcCalId", PanelCallView3.vo_call.getRowSet().getCurrentRow().getAttribute("CalId"));
    newdoc.setAttribute("CdcFilenaam",file.getName());
    newdoc.setAttribute("CdcBlob",blob);
    vo_calldoc.insertRow(newdoc);
    appmod.getTransaction().postChanges();
    Object[] inskey = new Object[]{ newdoc.getAttribute("CdcId")};
    appmod.getTransaction().commit();
    Key pkkey = new Key(inskey);
    Row[] rowarray = vo_calldoc.findByKey(pkkey,1);
    Row updrow = rowarray[0];
    System.out.println(updrow.getAttribute("CdcFilenaam"));
    updrow.lock();
    oracle.jbo.domain.BlobDomain myblob = (oracle.jbo.domain.BlobDomain)updrow.getAttribute("CdcBlob");
    int next;
    FileInputStream fileIn = new FileInputStream(file);
    OutputStream blobOut = myblob.getBinaryOutputStream();
    while ((next = fileIn.read()) != -1)
    blobOut.write(next);
    fileIn.close();
    blobOut.close();
    app.commitTransaction();

  • Updateable ViewObject Throws Error When Column Set To Null

    I have an updateable ViewObject that has not changed since it was created. In JDeveloper 9.0.3 I was able to pass a node with a null value into the ViewObject, post the changes, and the underlying table was updated without incident. We are upgrading the tools we use which includes JDeveloper. We need to clear the values (set them to null) in certaincircumstances. What is the secret to it? Either I have not set a parm properly or the code was malformed at the start (I did not create the initial code).
    The column to be updated is UpdatedBy.
    Original code - row.setUpdatedBy(null);
    Attempted change - row.setAttribute("UpdatedBy",null);
    Neither worked and threw the following:
    oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:java.math.BigDecimal with value:
    UpdatedBy is a BigDecimal type and the database column is NUMBER(9, 0). Nulls are allowable.
    All help is appreciated.
    Thanks,
    pdr
    Additional info:
    The original code works fine under 9.0.3 but not under 9.0.5.
    Column can be updated using the connect PrepareStatement and passing the update SQL.
    Message was edited by:
    pdreaiii

    I am now able to update the column using the setAttribute. Weird that it is now but not before.
    Still having an issue with inserting/updating rows using XML. Here is the XML node we are pushing to the ViewObject - the UpdatedBy child node was created with a null value:
    <AssessmentLockViewRow>
    <WorkerId>1236</WorkerId>
    <AsmtId>1593730</AsmtId>
    <SynchLock>N</SynchLock>
    <UpdatedBy>
    </UpdatedBy>
    </AssessmentLockViewRow>
    This was created using the following (trimmed for space:
    //start code
    //create the Node for persistance
    XMLHelper helper = new XMLHelper(SECOND_CHILD);
    try {
    helper.addNode(SECOND_CHILD, "WorkerId", workerId);
    helper.addNode(SECOND_CHILD, "UpdatedBy", updatedBy); // can be null
    } catch (NodeNotFoundException e) {
    error(CLASS_NAME, METHOD_NAME, e);
    throw new EventException(e);
    Node rowToAdd = helper.getRootNode();
    ApplicationModule am = _appMod;
    ViewObject vo = am.findViewObject(VIEW_OBJECT);
    Row r = vo.first();
    // r.setAttribute("UpdatedBy",updatedBy);
    vo.readRowXML((Element)rowToAdd, 0);
    am.getTransaction().validate();
    am.getTransaction().postChanges();
    //end code
    The app module was created using
    _appMod = (ApplicationModule)Configuration.createRootApplicationModule(
    APP_MODULE, APP_MODULE_CONFIG, envInfo);
    the envInfo is the user information.
    Do I have something wrong here? I think I am doing something wrong but can't spot it.
    Thanks.

  • About passivate/activate state in BC4J

    Hi,Does anyone know this question about passivateState/activateState in BC4J?
    the result of passivateStateForUndo(or passivateState) was not expected if I do the
    activateStateForUndo after do postChanges. for example:
    // create a View Object "deptVO"
    ViewObject deptVO = applicationModule.findViewObject("DeptView");
    //modify the first row then post.
    Row aDept = deptVO.first();
    aDept.setAttribute("Deptname", "testname1");
    appModule.getTransaction().postChanges();
    // Passivate the Application Module state
    appModule.passivateStateForUndo("snapshot1", null, 0);
    //Activate the Application Module state
    appModule.activateStateForUndo("snapshot1", ApplicationModule.ACTIVATE_REMOVE_FLAG);
    //Get the Deptname, but the returned value is not "testname1" that was put before Passivate.
    aDept = deptVO.first();
    System.out.println(aDept.getAttribute("Deptname"));
    the result is right If I change the performance sequence of postchanges and passivateStateForUndo.
    Thanks much.

    See Re: BC4J: activateStateForUndo rolling back to before the passivateStateForUndo

  • How to refresh the list of select one choice which is inside a table?

    Hello I am using Jdeveloper Version 11.1.2.1.0.
    The table is a normal table that is made to look like a treeTable.
    For some rows are or can be parents with Parent_vo_group_id = null and other are children with parent_vo_group_id = vo_group_id of the parent...
    If a children changes its parent_vo_group_id to null it can become a parent as well.
    I am having a select one choice inside a table column. The list comes from the same table with column Name:
    <af:table value="#{bindings.VoGroupAdminView2.collectionModel}" var="row"
                                                      rows="#{bindings.VoGroupAdminView2.rangeSize}"
                                                      contentDelivery="immediate"
                                                      visible="#{bindings.VoGroupAdminView2Iterator.currentRow != null}"
                                                      fetchSize="#{bindings.VoGroupAdminView2.rangeSize}"
                                                      partialTriggers="::soc1" styleClass="AFStretchWidth"
                                                      rowBandingInterval="0" editingMode="clickToEdit"
                                                      binding="#{adminGroupManagementBean.groupTable}"
                                                      selectionListener="#{adminGroupManagementBean.groupSelectionListener}"
                                                      rowSelection="single" id="t5">
                                                <af:column sortProperty="#{bindings.VoGroupAdminView2.hints.Name.name}"
                                                           sortable="false" styleClass="columnData"
                                                           headerClass="tableHeader"
                                                           headerText="#{bindings.VoGroupAdminView2.hints.Name.label}"
                                                           id="c1">
                                                    <af:inputText value="#{row.bindings.Name.inputValue}"
                                                                  requiredMessageDetail="Please enter a group name"
                                                                  label="#{bindings.VoGroupAdminView2.hints.Name.label}"
                                                                  required="true" id="it7" immediate="true" autoSubmit="true"
                                                                  columns="#{bindings.VoGroupAdminView2.hints.Name.displayWidth}"
                                                                  maximumLength="#{bindings.VoGroupAdminView2.hints.Name.precision}"
                                                                  shortDesc="#{bindings.VoGroupAdminView2.hints.Name.tooltip}"
                                                                  contentStyle="#{row.ParentVoGroupId eq null? 'font-weight:bold' : 'padding-left:20px'}"
                                                                  valueChangeListener="#{adminGroupManagementBean.groupNameChangeListener}"
                                                                  partialTriggers="soc2">
                                                        <f:validator binding="#{row.bindings.Name.validator}"/>
                                                    </af:inputText>
                                                </af:column>                                   
                                                <af:column sortProperty="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.name}"
                                                           sortable="false" styleClass="columnData"
                                                           headerClass="tableHeader"
                                                           headerText="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.label}"
                                                           id="c4">
                                                    <af:selectOneChoice value="#{row.bindings.ParentVoGroupId.inputValue}"
                                                                        label="#{row.bindings.ParentVoGroupId.label}"
                                                                        simple="true" immediate="true"
                                                                        required="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.mandatory}"
                                                                        shortDesc="#{bindings.VoGroupAdminView2.hints.ParentVoGroupId.tooltip}"
                                                                        id="soc2" autoSubmit="true"
                                                                        unselectedLabel="&lt;null&gt;"
                                                                        valueChangeListener="#{adminGroupManagementBean.parentIdValueChangeListener}"
                                                                        visible="#{row.bindings.ChildrenCount.inputValue eq 0 ? true : false}">
                                                        <f:selectItems binding="#{adminGroupManagementBean.selectOneChoiceList}"
                                                                        value="#{row.bindings.ParentVoGroupId.items}"
                                                                       id="si2"/>
                                                    </af:selectOneChoice>
                                                </af:column>
                                            </af:table> My select one choice uses the same iterator as the table.
    <iterator Binds="VoGroupAdminView2" RangeSize="-1" DataControl="AppModuleDataControl"    id="VoGroupAdminView2Iterator"/>The table uses this view called VoGroupAdminView:
    Select t1.vo_Group_id,     
           t1.name,
           t1.Vehicle_Owner_Id,
           t1.Graphical_Symbol,
           t1.Lm_Comment,
           t1.Parent_Vo_Group_Id ,
           decode (t2.children_count, null, 0, t2.children_count) as children_count
           from
    (SELECT VoGroup.vo_Group_id,     
           VoGroup.name,
           VoGroup.Vehicle_Owner_Id,
           VoGroup.Graphical_Symbol,
           VoGroup.Lm_Comment,
           VoGroup.Parent_Vo_Group_Id
      FROM VO_GROUP VoGroup
    START WITH VoGroup.Parent_Vo_Group_Id IS NULL
    CONNECT BY VoGroup.Parent_Vo_Group_Id = PRIOR VoGroup.Vo_Group_Id
    order SIBLINGS by VoGroup.name) t1,
    (select parent_vo_group_id, count (parent_vo_group_id) as children_count from vo_group
    group by parent_vo_group_id) t2
    where t1.vo_group_id = t2.parent_vo_group_id (+)the ParentVoGroupId attribute has list of values from this view object called VoGroupAdminLov:
    SELECT
        VO_GROUP.NAME,
        VO_GROUP.VEHICLE_OWNER_ID,
        VO_GROUP.PARENT_VO_GROUP_ID,
        VO_GROUP.VO_GROUP_ID
    FROM
        VO_GROUP
    WHERE  VO_GROUP.PARENT_VO_GROUP_ID is null
    and VO_GROUP.VO_GROUP_ID <> ?
    order by  VO_GROUP.NAMEI want to refresh the list of values in the select one choice everytime when i add a new row in the table, delete row in the table or change the value of select one choice component.
    What I have tried:
        public void parentIdValueChangeListener(ValueChangeEvent valueChangeEvent) {
            this.setValueToEL("#{row.bindings.ParentVoGroupId.inputValue}", valueChangeEvent.getNewValue());
            BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding voGroupAdminIterator = (DCIteratorBinding)bc.get("VoGroupAdminView2Iterator");
            Key selectedGroupKey = voGroupAdminIterator.getCurrentRow().getKey();
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            am.getTransaction().postChanges();
            am.getVoGroupAdminView2().executeQuery(); //refresh the table view object;
            am.getVoGroupAdminLov1().executeQuery(); //refresh the list of values view object
            voGroupAdminIterator.invalidateCache();  //remove the cache of the iterator
            voGroupAdminIterator.setCurrentRowWithKey(selectedGroupKey.toStringFormat(true)); // set the selected row again.
            RichSelectOneChoice soc =
                (RichSelectOneChoice)FacesContext.getCurrentInstance().getViewRoot().findComponent(":pt1:t5:soc2");
            AdfFacesContext.getCurrentInstance().addPartialTarget(soc);
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.groupTable);    
        }When i am adding a new row to the table its select one choice list is refreshed but only for the new row. The rest rows have not updated list of values for their select one choice components.
        public String addGroupButtonAction() {
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            ViewObjectImpl voGroupAdminView = am.getVoGroupAdminView2();
            Row newRow = voGroupAdminView.createRow();
             newRow.setNewRowState(Row.STATUS_INITIALIZED);
            voGroupAdminView.insertRowAtRangeIndex(0, newRow);
            am.getTransaction().postChanges();
            return "null";
        }Edited by: 897833 on Mar 19, 2012 9:07 AM

    I made a button to refresh the value of select one choice and it doesn't work yet.
    So I just move one of the
        public String refreshParentIdSOCButtonAction() {
            BindingContainer bc = BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding voGroupAdminIterator = (DCIteratorBinding)bc.get("VoGroupAdminView2Iterator");
            Key selectedGroupKey = voGroupAdminIterator.getCurrentRow().getKey();
            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            am.getTransaction().postChanges();
            am.getVoGroupAdminView2().executeQuery();
            am.getVoGroupAdminLov1().executeQuery();
            voGroupAdminIterator.invalidateCache();
            voGroupAdminIterator.setCurrentRowWithKey(selectedGroupKey.toStringFormat(true));
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.parentIdSelectOneChoice);  //refresh the binded SOC as you said
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.parentIdSelectOneChoiceList); //refresh the binded list even
            AdfFacesContext.getCurrentInstance().addPartialTarget(this.groupTable); //refresh the table it is in;
            return null;
        }Edited by: 897833 on Mar 23, 2012 2:58 AM

  • JAVA ERROR MESSAGE WHEN POSTING CHANGES TO OC4J

    We are using Oracle9iAS v1.0.2.2.2a. From the Client we succed in
    posting and commiting changes to our BC4J on the Middletier. The next time we
    postchanges we get the following exeption on the OC4J AS:
    oracle.jbo.DMLException: JBO-26080: Error while selecting entity for Styles
    at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelect(OracleSQLBuilderImpl.java:841)
    at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:3839)
    at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:2630)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.lock(StylesImpl.java:635)
    at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:1848)
    at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:1790)
    at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:1570)
    at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:754)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.setStyleName(StylesImpl.java:152)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.setAttrInvokeAccessor(StylesImpl.java:446)
    at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:680)
    at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:903)
    at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:819)
    at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:948)
    at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:925)
    at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:717)
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.updateRow(RuntimeViewRowSetIteratorInfo.java:311)
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.readPiggyback(RuntimeViewRowSetIteratorInfo.java:193)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readPiggyback(AbstractRemoteApplicationModuleImpl.java:2419)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.isTransactionDirty(AbstractRemoteApplicationModuleImpl.java:1788)
    at oracle.jbo.server.remote.ejb.EJBApplicationModuleImpl.riIsTransactionDirty(EJBApplicationModuleImpl.java:2454)
    at RemoteStylecardModule_StatefulSessionBeanWrapper6.riIsTransactionDirty(RemoteStylecardModule_StatefulSessionBeanWrapper6.java:12889)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:80)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01002: fetch out of sequence
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:184)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:241)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1477)
    at oracle.jdbc.ttc7.TTC7Protocol.executeFetch(TTC7Protocol.java:779)
    at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2336)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2462)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:435)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:375)
    at com.evermind.sql.FilterPreparedStatement.executeQuery(FilterPreparedStatement.java:269)
    at com.evermind.sql.FilterPreparedStatement.executeQuery(FilterPreparedStatement.java:269)
    at com.evermind.sql.FilterPreparedStatement.executeQuery(FilterPreparedStatement.java:269)
    at com.evermind.sql.OrclPreparedStatement.executeQuery(OrclPreparedStatement.java:47)
    at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelect(OracleSQLBuilderImpl.java:629)
    at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:3839)
    at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:2630)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.lock(StylesImpl.java:635)
    at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:1848)
    at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:1790)
    at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:1570)
    at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:754)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.setStyleName(StylesImpl.java:152)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.setAttrInvokeAccessor(StylesImpl.java:446)
    at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:680)
    at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:903)
    at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:819)
    at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:948)
    at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:925)
    at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:717)
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.updateRow(RuntimeViewRowSetIteratorInfo.java:311)
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.readPiggyback(RuntimeViewRowSetIteratorInfo.java:193)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readPiggyback(AbstractRemoteApplicationModuleImpl.java:2419)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.isTransactionDirty(AbstractRemoteApplicationModuleImpl.java:1788)
    at oracle.jbo.server.remote.ejb.EJBApplicationModuleImpl.riIsTransactionDirty(EJBApplicationModuleImpl.java:2454)
    at RemoteStylecardModule_StatefulSessionBeanWrapper6.riIsTransactionDirty(RemoteStylecardModule_StatefulSessionBeanWrapper6.java:12889)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:80)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    oracle.jbo.DMLException: JBO-26080: Error while selecting entity for Styles
    at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelect(OracleSQLBilderImpl.java:841)
    at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:3839)
    at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:2630)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.lock(StylesImpl.java:635)
    at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:1848)
    at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:1790)
    at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:1570)
    at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:754)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.setStyleName(StylesImpl.java:152)
    at dk.bestseller.bestinfoII.purchase.stylecard.StylesImpl.setAttrInvokeAccessor(StylesImpl.java:446)
    at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:680)
    at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:903)
    at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:819)
    at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:948)
    at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:925)
    at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:717)
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.updateRow(RuntimeViewRowSetIteratorInfo.java:311)
    at oracle.jbo.server.remote.RuntimeViewRowSetIteratorInfo.readPiggyback(RuntimeViewRowSetIteratorInfo.java:193)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readPiggyback(AbstractRemoteApplicationModuleImpl.java:2419)
    at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.isTransactionDirty(AbstractRemoteApplicationModuleImpl.java:1788)
    at oracle.jbo.server.remote.ejb.EJBApplicationModuleImpl.riIsTransactionDirty(EJBApplicationModuleImpl.java:2454)
    at RemoteStylecardModule_StatefulSessionBeanWrapper6.riIsTransactionDirty(RemoteStylecardModule_StatefulSessionBeanWrapper6.java:12889)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:80)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    We are in the Client part on the application trying to postchanges to OC4J
    aftet a succesfull commit when the exception is thrown.
    //Check if any data changed and postChanges if true
    if (styleCardModule.getTransaction().isDirty()) {
    System.out.println("styleCardModule.getTransaction().postChanges()");
    styleCardModule.getTransaction().postChanges();
    The module works ok if we instead of commiting changes do a rollback.
    Our BC4J are generated with JDeveloper 9i RC2.
    The application (BC4J) works fine when running on JDeveloper 9i RC2.
    Anyone got a solution to this problem?

    Yes. I believe that there is an internal plug-in installed / script programming active that does something which requires Java.
    You could look up the definition of the Structured Application which is used for those XML files to check if a "structure client" is defined.
    But it has nothing to do with FrameMaker as shipped by Adobe.
    - Michael

Maybe you are looking for

  • Why does my iPod Classic keep trying to sync items from my iTunes library that are no longer there?

    I have an iPod classic, 160GB model, that keeps trying to sync items that are no longer in my iTunes library, is there a way to stop it from doing this? My iTunes library is on my MacBook Pro (17-inch, Late 2011), 2.4 GHz Intel Core i7, 8 GB 1333 MHz

  • Looking for "Color Matching" in Tiger Printer dialogue box

    Hello, I'm in transition from using Photoshop 7 in Classic to Photoshop CS in Tiger. I built a printer profile in ProfileMaker 5.xx that I would attach to the Printer Dialogue box in Classic under "Color Matching." Thus my prints would pretty much ma

  • New Mac user here.....

    I actually have 2 questions. First I installed Growl for e-mail notifications. I later deleted the file using app zapper. I thought this deleted all files associates with the application but I still see preferences for Growl Mail in the mail app. any

  • Receiving messages from people not in my contacts ...

    Hello, For the past week I have been receiving messages/calls from people who are not in my contact list.My security settings clearly were set to only allow contacts from my list only to message and call me.Why is this happening?It's kind of annoying

  • IDCS4. Flash version when exporting to .swf?

    G'day, Gotta say I'm loving CS4, it creates faster and more efficent workflows and that time saving makes me more money. That aside, when exporting a document with hyperlinks, buttons etc. for a website, what version of Flash Player does the end user