DB session used by an AM

Hello,
a typical scenario is when you have a web application referencing an application module, which, in turns, uses some db connections from a given datasource.
Suppose I want to do some DML via some exported AM methods attached to some button actions on the page. These methods get a DBTransaction() of the AM to build CallableStatements that in turn will call stored procedures WITHOUT committing.
How can I be sure that all those calls issued by spot user actions (during his/her http session) share the same DB session?
Thanks.

Hello John,
but when you have buttons that end up performing the following block of code, there is no entity taking care of the modifications on the DB, since as far as I know calling the statement this way bypasses any potential services from BC components. This is why I asked if all these kind of statements issued by user requests at any time belong to the same DB session, so that on commit the whole group of previous modifications are committed together as if they were a single atomic transaction.
Basically I am asking if there is any risk that the following method will use different DB sessions when the user clicks many times on the same button in one page during one HTTP browser-session.
In other words I am afraid that getDBTransaction() might take different DB connections from the pool of available connections, where each connection also has a different DB session for some reason.
    public void doSomething() {
        CallableStatement cs;
        cs = getDBTransaction().createCallableStatement(" Declare  Begin  mypck.do_something_involving_dml_on_different_objects(?, ?); End; ", 0);
        try {
            cs.setString(1, "param1");
            cs.setString(2, "param2");
            cs.execute();
            cs.close();
        } catch (SQLException e) {
    }

Similar Messages

  • How do I get at Session using Context's

    Hi,
    Please can someone help me out. I am working on an extended version of the jboss DatabaseServerLoginModule and part of this involves overidding the login() method. The login() method provides no parameters such as request etc and so I have no way of getting at the session.
    How can I get at the session using Context's?
    i.e. starting with say InitialContext and going from there....
    any ideas?
    Regards,
    Paul.

    Sounds like a JBoss question to me. Seems to me that JBoss support would be the place to go for answers. It's really not a general Java programming question.

  • How to set a variable in portal session using web dynpro java.

    Hi,
    I have created a web dynpro application, which is running inside portal. I have created a role called "R1". Inside role R1, i have created 3 workset W1, W2 and W3. and inside each workset i have some pages and iviews.
    My requirement is when user logins to the portal , and when he clicks on role R1 for the first time, a login page should come (so that we can do revalidation), and when he enters his password again in that login page , then only workset W1, W2 and W3 should be visible/accessible to him and after successful revalidation, if he clicks again on role R1, in that particular portal session, than that login page should not come.
    for this, i thought i will set a variable in portal session, whenever user successfully revalidated himself, and if after successful revalidation he clicks again on role R1, i will check in doinit method of webdynpro whether variable is set or not (which i already set on successful revalidation), and if it is set then i will do Donavigation else i will present login page to the user.
    Can anyone tells me how to set a variable in portal session using web dynpro java.
    thanks
    Arush

    Hi,
    Try this:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, key, value)
    WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, key)
    Ex:
    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"Key1","Value1");
    String value1=WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,"Key1").toString();
    /people/william.cui/blog/2007/02/12/sharing-session-context-between-parent-and-external-windows-running-on-same-host
    Regards,
    Charan

  • Session using db link?

    Some of the Users are connecting to my database through database links.
    How to know the user session is using db link?
    Is there any view, which shows connected dblink's ?

    Even v$session would show this, but indirectly.
    Whenever any query is given through a dblink, it automatically starts a transaction, so connecting this with v$transaction with username, you can find the transaction and from there get through v$sqlarea or v$sql to find the sql with dblink. Though its a round about way, it is possible to find session using dblinks, thats is my point. pls try it and let us know.
    Siva

  • How can I enable session(using url)  tracking in home page

    i am developing bidding application. How can I enable session(using url) tracking in home page ?
    for example :
    http://mydomine.com/index.jsp;jsessionid=4A38A4496F6862681DFD09CD6D648485.tomcat75
    please help me.

    Doubleposted. Please continue here: [http://forum.java.sun.com/thread.jspa?threadID=5308686&tstart=0]
    In the future, do not use the back button to edit the message, but use the edit button instead. Otherwise you're reposting the form again. You should know that better as being a web developer.

  • Flex session using blazeds?

    Hello,
    Need help on managing the Flex session using blazeds. If source is available, it would help a lot.

    Hi saisri2k2,
    Instead of making use of Server side session you can make a logic of your own at the client side itself by making use of the FlexEvent.IDLE and doing the appropriate action accordingly.
    You can google for the FlexEvent.IDLE  keyword. So if the user stays idle for a particular time you can register a check in the eventListener registerd for FlexEvent.IDLE and navigate or redirect user to another page.
    Thanks,
    Bhasker

  • Problem in tracing session using ORADEBUG utility?

    I want to trace a session using oradebug utility.what i have done is
    SQL>oradebug setospid 25807
    SQL> oradebug set ospid 27441
    unknown command beginning "oradebug s..." - rest of line ignored.
    How i can race another session using oradebug utility.
    Thank you...

    The correct syntax is
    oradebug setospid <Unix pid>
    You can 'attach' to one process only.
    You have two oradebug setospid commands issued, the latter one is wrong, but wouldn't have worked anyway.
    The usual method to trace a session is
    oradebug setospid ...
    oradebug event 10046 trace name context forever, level 12
    This should work.
    Note you can accomplish the same using dbms_system.set_ev
    Sybrand Bakker
    Senior Oracle DBA

  • Setting and retrieving session using pl/sql

    How to set and retrieve session using pl/sql?Can anyone help me?

    mrs wrote:
    create or replace
    function get_login_details(in_user in VARCHAR2,in_pwd in VARCHAR2,in_cname in VARCHAR2)
    ..snipped..The code should look as follows:
    create or replace function AuthenticateUser( userName varchar2, userPassw varchar2, userGroup varchar2 )
    return integer is
      i integer;
    begin
      --// purpose of the SQL is simply to check if such a row exist -
    --// no data from the row needs to be fetched
      select 1 into i from acl_users_gv
      where user_name = userName
      and password = userPassw
      and entity_group_name = userGroup;
      --// if the SQL succeeded, then the row exists and matches
      --// the authentication details
      return( 0 );
    exception when NO_DATA_FOUND then
      --// SQL failed to find a row - authentication details do
      --// not exist
      return( 1 );
    end;No need to fetch data unnecessarily. No need too check the fetched data when the column values are already checked via the SQL filter condition (predicate).
    No need to return a flag variable as a freely formatted text string containing Successful Login and login failed. That is not a robust design to use a string variable like that. Use boolean for true/false. Or use integer values 0/1.
    This is my function get_login_details.And I need to get this 'o_mesg' in other java file also.Standard PL/SQL call from Java. The SQL string to execute contains an anonymous PL/SQL and needs to use bind variables. E.g.
    begin
      :result := AuthenticateUse( :userName, :userPassw, :userGroup );
    end;
    Can you suggest the right way, how I can get this variable in other pages?That depends on whether there is database session state. If there is, authentication can be done once only via a trusted context, that specifies whether the session is authenticated.
    If this is done from an app server that uses a db session pool and stateless db sessions, the state needs to be kept in the app server.
    Do you understand what stateful versus stateless db sessions are, and what the differences are?

  • Setting session using pl/sql

    How to set and retrieve session using pl/sql?Can anyone help me?

    This is the wrong forum for SQL or PL/SQL questions.
    1. Post your question in the SQL and PL/SQL forum
    https://forums.oracle.com/forums/forum.jspa;jsessionid=8d92100c30d7960321c250bf4adeaa5dcac037eb147c.e34SbxmSbNyKai0Lc3mPbhmSbNaLe0?forumID=75&start=0
    2. Edit this thread and post the link to your new question.
    3. Mark this thread ANSWERED so people will follow up in the other forum.
    When you post your new question provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION). You will also need to explain what you mean by 'set and retrieve' session. A session is created when a logon is successful so 'set' and 'retrieve' only have meaning in terms of trying to set or retrieve session parameters that may be in effect.

  • How to store php sessions using memcached and unix socket

    I am running Arch linux with systemd, nginx, and php with php-fpm. I am trying (and failing) to configure memcached to store sessions using a unix socket. I have memcached installed and active, however, I am unable to disable networking. I added the following line to /etc/conf.d/memcached
    MEMCACHED_ARGS="-s unix:///tmp/memcached.sock -a 666"
    I also tried:
    MEMCACHED_ARGS="-s /tmp/memcached.sock -a 666"
    MEMCACHED_ARGS="-s unix:/tmp/memcached.sock -a 666"
    when I restart memcached I always get:
    memcached.service - Memcached Daemon
              Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled)
              Active: active (running) since Sat 2013-01-19 17:41:15 PST; 5min ago
            Main PID: 773 (memcached)
              CGroup: name=systemd:/system/memcached.service
                      └─773 /usr/bin/memcached -l 127.0.0.1
    when I run php script with sessions php error log shows (not surprisingly):
    [19-Jan-2013 16:46:45 America/Los_Angeles] PHP Warning:  Unknown: Failed to write session data (memcached). Please verify that the current setting of session.save_path is correct (unix:/tmp/memcached.sock) in Unknown on line 0
    I also installed the php-memcached package but I don't what it does or how to get it going. I uncommented the following line in /etc/php/conf.d/memcached.ini:
    extension=memcached.so
    but that didn't change anything.
    Any insights or suggestions would be greatly appreciated.

    Look at this link -http://odiexperts.com/getting-one-or-several-unknown-files-from-a-directory
    change the command to fetch the ls command and write into File and then using either java or jython break the data and fetch the file name and date and insert into log table.
    (or)
    you can use the os.system command and get the complete ls command into string and then process and insert it.
    Let us know if you need any other help.

  • How to remove the Sessions used in the application

    Hai Techies,,,
    i am using many number of sessions in my application, for example i am using 5 sessions in reports module
    my application is a web based application
    if can't remove the sessions it contains the huge amount of data , my application is going into mess, and the application performance will be decreased..
    Can anybody tell the solution for this Problem
    How to remove the Sessions used in the application
    Hoping a reply
    Thanks & Regards
    Krishna mangamuri

    Hai Gita,
    i am not able to do the session invalidate method bcoz, i am mainatainting the session from login along with the current userid who is login into the system and putting some of the data in session....
    thats session is to be valid upto when i click on logoff link
    except that i have to remove the sessions in my application
    while navigating from one jsp to another i have to remove the sessions, bit somes times that sessions may be used somewhere
    Can u Understand My problem
    session remove method may also helpful to me but some times it will casue some prob to me
    Is there any other Way to remove the sessions in the Application ????
    Thanks & Regards
    Krishna Mangamuri

  • How to create a session using call transaction method.

    hi , this is nagaraju,
    How to create a session using call transaction method.

    Hi,
    About Data Transfer In R/3 System
    When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.
    In the process of replacing current applications and transferring application data, two situations might occur:
    •     The first is when application data to be replaced is transferred at once, and only once.
    •     The second situation is to transfer data periodically from external systems to SAP and vice versa.
    •     There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.
    The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called “batch input” or “batch data communication”.
    1. SESSION METHOD
    2. CALL TRANSACTION
    3. DIRECT INPUT
    First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.
    Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.
    When the program has finished generating the session, you can run the session to execute the SAP transactions in it. Unless session is processed, the data is not transferred to database table.
    A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program.
    SESSION METHOD
    Data is not updated in database table unless Session is processed.
    No sy-subrc is returned.
    Error log is created for error records.
    Updation in database table is always synchronous
    CALL TRANSACTION
    Immediate updation in database table.
    Sy-subrc is returned.
    Errors need to be handled explicitly
    Updation in database table can be synchronous Or Asynchronous.
    Regards,
    Sruthi.

  • How to restore previous session using the control panel

    I have tried all pathways through firefox with no results. There is a way to restore previous session using the control panel. I tried it before and it worked but I forgot to write down the pathway and lost this method. Does anyone know it?
    thank you

    I can't think of anything useful in the Windows Control Panel, but perhaps you were using the System Restore feature? As a shortcut for that, you could try the Previous Versions tab of the Properties dialog for sessionstore.js or sessionstore.bak.
    First, I recommend backing up your current sessionstore files.
    Open your current Firefox settings (AKA Firefox profile) folder using
    Help > Troubleshooting Information > "Show Folder" button
    Leaving that window open, switch back to Firefox and Exit
    Copy sessionstore.js and sessionstore.bak to a safe location (e.g., Documents folder). If you cannot see those file extensions, try this Microsoft support article: [http://support.microsoft.com/kb/865219].
    Then right-click sessionstore.js, click the Previous Versions tab, and see what is available.

  • How to pass data between two internal sessions using ABAP memory?

    Hi,
    How to pass data between two internal sessions using ABAP memory?
    It would be fine if you could explain with an example.
    And also let me clear about the data passing between two main sessions and two external sessions with specific examples.
    Thanks.

    Hi ,
      check the example.
    Reading Data Objects from Memory
    To read data objects from ABAP memory into an ABAP program, use the following statement:
    Syntax
    IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.
    This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO <g i > option, the data object <f i > in memory is assigned to the data object in the program with the same name. If you do use the option, the data object <f i > is read from memory into the field <g i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
    You do not have to read all of the objects stored under a particular name <key>. You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name <key>, SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name <key>, SY-SUBRC is always 0, regardless of whether it contained the data object <f i >. If the cluster does not contain the data object <f i >, the target field remains unchanged.
    In this statement, the system does not check whether the structure of the object in memory is compatible with the structure into which you are reading it. The data is transported bit by bit. If the structures are incompatible, the data in the target field may be incorrect.
    PROGRAM SAPMZTS1.
    DATA TEXT1(10) VALUE 'Exporting'.
    DATA ITAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
    DO 5 TIMES.
      ITAB-BOOKID = 100 + SY-INDEX.
      APPEND ITAB.
    ENDDO.
    EXPORT TEXT1
           TEXT2 FROM 'Literal'
      TO MEMORY ID 'text'.
    EXPORT ITAB
      TO MEMORY ID 'table'.
    SUBMIT SAPMZTS2 AND RETURN.
    SUBMIT SAPMZTS3.
    The first part of this program is the same as the example in the section Saving Data Objects in Memory. In the example, the programs SAPMZTS1 and SAPMZTS2 are called using SUBMIT. You can create and maintain the programs called using the SUBMIT statement by double-clicking their names in the statement. For further information about the SUBMIT statement, refer to Calling Executable Programs (Reports)
    Example for SAPMZTS2:
    PROGRAM SAPMZTS2.
    DATA: TEXT1(10),
          TEXT3 LIKE TEXT1 VALUE 'Initial'.
    IMPORT TEXT3 FROM MEMORY ID 'text'.
    WRITE: / SY-SUBRC, TEXT3.
    IMPORT TEXT2 TO TEXT1 FROM MEMORY ID 'text'.
    WRITE: / SY-SUBRC, TEXT1.
    Example for SAPMZTS3:
    PROGRAM SAPMZTS3.
    DATA JTAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
    IMPORT ITAB TO JTAB FROM MEMORY ID 'table'.
    LOOP AT JTAB.
      WRITE / JTAB-BOOKID.
    ENDLOOP.
    The output is displayed on two successive screens. It looks like this:
    and
    The program SAPMZTS2 attempts to read a data object TEXT3 from the data cluster "text", which does not exist. TEXT3 therefore remains unchanged. The existing data object TEXT2 is placed in TEXT1. In both cases, SY-SUBRC is 0, since the cluster "text" contains data.
    The program SAPMZTS3 reads the internal table ITAB from the cluster "table" into the internal table JTAB. Both tables have the same structure, namely that of the ABAP Dictionary table SBOOK.
    Pls. reward if useful.....

  • How to Identify database sessions used by forms sso user sessions?

    Hi:
    When using forms with SSO, all database sessions are opened by the same OSUSER (usually oracle), from the same machine (usually the forms server) and by the same program (usually [email protected] [TNS V1-V3]).
    I need a way to identify the database session (v$session) that is beeing used by a specific SSO user. By using SSO, we say implicitly that all users using that SSO resource will be connect to the database by a specific database user.
    So, what can I do to identify the database session that a specific forms user is using ?
    Thanks
    Joao Oliveira

    You could try something like the following in a when new form instance trigger:
    declare
    authenticated_username varchar2(30);
    begin
    authenticated_username := get_application_property(`sso_userid');
    DBMS_APPLICATION_INFO.SET_CLIENT_INFO (
    client_info IN VARCHAR2);
    end;
    This will store the sso userid in the client_info field of v$session.
    I hope this works for you.
    Randy McGregor

  • How manage timeout Session using java SDK?

    Hi everyone !
    I'm working with BO 4.1 and the Java SDK. I'm refreshing and exporting webi reports in my code. But it happens, sometimes, the report takes longer to refresh (when calling "setPrompts") and the session is over (timeout like when you're connected in the Launchpad).
    Is there any specific way for me to test if the call to setPrompts ends without timeout? Because, now, if it ends by a timeout, I do not see anything and I'm exporting a blank document. No error or exception :-/
    Do I have to use de EnterpriseSession?
    Thanks in advance !

    Hi Jerome,
    To understand BO session management, refer to the below document.
    http://scn.sap.com/community/bi-platform/blog/2013/11/27/session-management-bible
    How do you specify that there is a timeout? Do you get timeout errors in web intelligence server logs?
    Check whether enterprise session is still valid.
    What is the approximate time delay you observe for setPrompts when you observe the timeout?
    -Prithvi

Maybe you are looking for

  • Nw04 to nw04s

    Hi, got a couple of questions regarding nw04 to nw04s currently we are on ep 6.0 sp14 and interested to use the features of NW04s. 1. is it an upgrade or migration from nw04 to nw04s? i hope it is an upgrade, am i right? 2. is it mandatory to upgrade

  • XSU: Nested Collections?

    Does anyone know of a way to get around Oracle's limitation on nested collections? I have been using XSU to present XML to our Java application layer using objects and object views. Casting multisets works fine for repeating elements as long as the e

  • Listening to BBC Radio

    Is there anyway of listening to BBC radio through itunes? I have tried to use BBC feeds through realplayer but i can't get it to work, it just keeps timing out, even with the newest real 10 and searching the help pages. Wondered if I could avoid othe

  • ALE, IDOC - need to send IDOC and create a text file

    Hi, i need to send idoc to some other system and create a text file in that. I want sent data to Channel Cluster. what are the settings required for that in transactions BD54 SCC4 SM59 - which connection is required WE21 - which type of port WE20 - w

  • Restoring my RAW files from the Vault.

    I keep my Aperture photo files on an external hard drive and back them up in the Vault after every import. This external drive just crashed. I have a replacement drive and want to restore these files from the Vault and be able to use them. I called A