Why my transaction isn't dirty?

Hello

JDev 11.1.2.4

I have a form with fields of automatic submission. I have change some values that are automatically submitted. So I let the workflow, and the finalizer is called.

In the finalizer, I check if the transaction is dirty before rollbacking.

ApplicationModule m = Configuration.createRootApplicationModule (WEB_MODULE_DEFINITION, WEB_MODULE_CONFIG);
If (am instanceof WebAppModuleImpl) {}
return (WebAppModuleImpl) am;

}

{if (am.getTransaction (). IsDirty())}

AM. Rollback();

}

The problem is that, even if I change any value, the transaction is still NOT dirty. I know that some changes have been posted, because I get the warning for uncommitted data.

Is there a reason why the transaction is not dirty? Is there another way to check for this?

Thank you

I think I found a solution. I wrote a finalizer that I use for all workflows where the user can change and sail away. The finalizer basically Gets the data control frame and for each of the control data it holds, check if it is modified, as appropriate rollback. It seems to work.

public void finalizer() {}
DCBindingContainer links = ADFUtils.getDCBindingContainer ();
BindingContext bctx = bindings.getBindingContext ();
DCF DataControlFrame = bctx.findDataControlFrame (bctx.getCurrentDataControlFrame ());
{for (DCDataControl dc: {dcf.datacontrols ())}
If (dc.isTransactionModified ()) {}
dc.rollbackTransaction ();
_logger.info ("Data Control" + dc.getName () + "rollbacked");
}
}

Tags: Java

Similar Questions

  • Why my photos isn't strong enough resolution to print?  Even 4 x 6.  Shooting with / Canon70d

    Why my photos isn't strong enough resolution to print?  Even 4 x 6.  Shooting with / Canon70d. What I need to change a setting on my camera, or do something in 5 Lightroom to correct the resolution?

    Please tell us more, how are you uplloading what files where? I'm trying to see what that has to do with Lightroom...

    But you can export from Lightroom by selecting those you want printed (I would say making a collection of them) and exporting them to a file to download.

    To get a handle on the export of watch this video: http://tv.adobe.com/watch/getting-started-with-adobe-photoshop-lightroom-5/lightroom-5-exp orting-images /

  • Why my computer isn't asking my office password remotely?

    Hello

    I have remote desktop laptop at home (Windows 7 Pro) on my work computer (Windows Server 2008 R2). I have a user name and password on the remote computer, but for some reason any for the past few days when I start an RDP session of my home computer, I'm not be prompted to enter my remote user name and the password. I am currently connected directly to my account on the remote computer. I don't remember changing all the settings on my computer at home or the remote control for example save the user name or password. So not sure why this is happening.
    How can I activate the userid and password prompt return on?

    Sorry to post the question above. I was so much confidence that I had not changed the settings that I thought something was seriously wrong. But after that investigation more realized that the 'ask me for the zone audit powers"was not checked in the options. So I checked him and everything is good now - be prompted for my user name and password when you connect.

  • Why Distributed Transaction error at the Message bean but not not Backing Bean?

    Hi guys,.

    * Update * I read the second post first.

    Using JDeveloper 12.1.2.0.0 and integrated WebLogic server of the same version.

    I have an ADF program where a draft of the application using JDBC in a message bean.  If I create an Application Module within the project and then sign in using its connection (java: comp/env/jdbc/MyAdfConnDS), then the code below works fine.  However, if I search connection JDBC (jdbc/MyJdbcDS), I have configured in WebLogic myself, then I distributed transaction errors.  How can I configure my JDBC connection to imitate the one who creates the AppModule?  This way I can run prepared explicitly stated and validation of the call?

    Here is my code JDBC

            conn.setAutoCommit(false);
            PreparedStatement statement = conn.prepareStatement(sql);
            statement.setLong(1, companyAccountId);
    // errors here
            statement.execute();
            conn.commit();
            statement.close();
    
    
    

    Which results in the error

    // prepared statement.
    DELETE BUSINESS_PARTNERS WHERE MASTER_TYPE_KEY = 'C' AND COMPANY_ACCOUNT_ID = ?
    java.sql.SQLException: Cannot call commit when using distributed transactions
                at weblogic.jdbc.wrapper.JTAConnection.commit(JTAConnection.java:373)
                at com.sample.myProduct.jms.clients.MyClient.deleteEntities(MyClient.java:211)
                at com.sample.myProduct.jms.clients.MyClient.importData(MyClient.java:155)
                at com.sample.myProduct.jms.beans.ImportMessageBean.onMessage(ImportMessageBean.java:91)
                at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:575)
                at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:477)
                at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:375)
                at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4855)
                at weblogic.jms.client.JMSSession.execute(JMSSession.java:4529)
                at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3976)
                at weblogic.jms.client.JMSSession.access$000(JMSSession.java:120)
                at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5375)
                at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:550)
                at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
                at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
    
    
    

    Here is a screenshot of all the available drivers: www.williverstravels.com/JDev/Forums/Threads/3544909/drivers.png, as well as the configuration of the transaction screen www.williverstravels.com/JDev/Forums/Threads/3544909/config.png

    I've tinkered enough to feel quite strongly, it is not an error in coding, but rather something in Weblogic.  I read what I can, but I don't know how the AppModule creates connections.  I would not add an AppModule just to retrieve its data source / login information if I don't.

    Ideas?

    Obviously, your message bean is configured to participate in a global transaction (for example, a JTA transaction). It is a behavior of the default message bean, even if you have not explicitly configured. When you get and use a JDBC connection in your message bean, this connection is attached to and participates in the overall transaction message bean (because you used compatible driver Oracle XA, it is seen on the 1st screenshot in your post), so you cannot perform local validation on the JDBC connection.

    Commit / rollback in this case can only be performed on the overall transaction (if the message bean is configured with the transactions managed by container) to be automatically or manually on the UserTransaction object (if the message bean is configured with bean-managed transactions). In other words, you must remove the conn.commit () statement, which is erroneous and obsolete when it is used in your message bean. If the message bean uses transactions managed by container, the container will commit / rollback automatically at the end of the method all the resources involved in the overall transaction (including your JDBC connection). If the method completed successfully (without exception), a validation will be performed. If the method fails (i.e., it ends with an exception), a cancellation will be made. If the message bean uses bean-managed transactions, the transaction is committed/restored when you explicitly call UserTransaction.commit () or UserTransaction.rollback ().

    The code above worked in a managed bean because JSF, ADF BC or ADF Faces applications require and participate in JTA transactions, then your JDBC connection has not been attached to a global transaction and you were able to perform local validation on the JDBC connection.

    You have two options to solve the problem. It depends on if you want your operations of JDBC to be in a global transaction with the bean of the message itself and its other actions or not. If they must be in a global transaction, then just remove the conn.commit () statement from your code. If they shouldn't be in a global transaction, you must either configure the message bean not to participate in global transactions or to configure the data source to use the «of the (thin) Oracle driver...» "instead of"Oracle (XA Thin)... driver. " ». (Remember to score the DataSource DO NOT to participate in a global transaction in the 2nd page of the data source configuration dialog in the management of WLS Console).

    NB. I highly recommend that you keep the global transactions. If you choose not to use a global transaction, it can happen that you committed the JDBC operations but an exception that happens after that, so the JMS message is not removed from the queue of messages and it will be processed after that, which causes the same operations of JDBC to be played and committed twice which must be avoided.

    Dimitar

  • Why my model isn't updating pages?

    Hello - I'm a beginner and I'm going quietly crazy trying to understand why my model changes are not displayed in my pages.

    I can create a new page for example clue of my model dwt no problem, but if I try to change the image of the banner or the title nothing pops up after I update the pages using this template. I made a model with many editable regions because I thought changing the banner image id according to the theme of the page... could this be a problem of regions modifable?

    The html pages and the model are in the same site... What on earth I forget to do when I refresh the model and make changes?

    Thanks in advance for maybe really stupid question (teaching myself dreamweaver in English with french, not easy software!)

    "model"?  You mean "model"?

    Here are seven common mistakes which will result in changes of proliferation do not model for child-

    1 rename the Templates folder

    2 move the folder models to another level of folder in the site other than the root level

    3. move a template outside of the Templates folder.

    4 changes to an editable model (which is not set)

    5. on the assumption that the changes made to the model will be will be by simply downloading the file Template modified on the server without downloading also files the modified

    6 corrupt the site cache to make the link between the model and the child page is broken

    7. bad create your child pages simply open the template, adding specific content on the page and re-register the model with an extension rather than expanding *.dwt *.html. (you can tell if this is the case by looking at the code on a page of the child - if you see something like