Forum Stats

  • 3,814,961 Users
  • 2,258,937 Discussions
  • 7,892,898 Comments

Discussions

Make a separate transaction, but reuse the connection.

Pamela
Pamela Member Posts: 201 Blue Ribbon
edited Nov 19, 2015 4:12AM in JDeveloper and ADF

Hello,

I am using JDeveloper 11.1.2.3.0.

I have an application, that uses a single Application Module.

On every page of the application, besides the login page I need to have a few buttons, that change the language and then update the language of the user in the database and commit the new language.

The commit from these buttons should only commit the change of the language in the user table and shouldn't commit any other changes. Therefore I want to have these buttons to open an isolated transaction from the other.

I tried putting these buttons in a bounded taskflow having an "Isolated data control" and "Always begin a new transaction" options set.

This didn't work probably, because I have only a single Application Module.

If I add a second root Application Module the things will work, but it will create additional connection to the database.

How can I use the connection of the first Application Module?

Is there a way to do it without second Application Module?

Edit: I wonder if there is a need to put these translation buttons in a separated taskflow. It will be easier to leave them on the page template... 

Regards,

Pamela

Best Answer

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,252 Red Diamond
    edited Nov 17, 2015 10:05AM Answer ✓

    Pamela, when you use a task flow with isolated data control and 'always begin a new transaction' this will create a second application module with it's own connection. You don't need a second application module, the framework instantiate one for this case.

    What did not work when you tried it this way?

    Timo

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,252 Red Diamond
    edited Nov 17, 2015 10:05AM Answer ✓

    Pamela, when you use a task flow with isolated data control and 'always begin a new transaction' this will create a second application module with it's own connection. You don't need a second application module, the framework instantiate one for this case.

    What did not work when you tried it this way?

    Timo

  • Pamela
    Pamela Member Posts: 201 Blue Ribbon
    edited Nov 17, 2015 10:12AM

    When I have input fields with autoSubmit="true" on my form pages and I press the button to change the language, it commits those fields.

    If the fields don't have autoSubmit="true" their value is not submitted and not committed and after the page is refreshed the old value of the input fields is set.

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,252 Red Diamond
    edited Nov 17, 2015 10:17AM

    If the buttons and the change of language in their own task flow with 'always begin a new transaction' this should not happen.

    The commit of the task flow should be done in another transaction.

    Timo

    Pamela
  • Pamela
    Pamela Member Posts: 201 Blue Ribbon
    edited Nov 19, 2015 4:12AM

    Yes you are right! Seems like I made a mistake while testing.

This discussion has been closed.