Handling two different sessions

Hi,
User1 executed following query and not done commit/rollback.
UPDATE EMP
SET ENAME='JSMITH'
WHERE EMPNO=7349;
1 row updated.
At the same time user2 tries same on same record:
UPDATE EMP
SET ENAME='KSMITH'
WHERE EMPNO=7349;
But this user/process will be suspened till user1 commits/rollbacks.
Once user1 commits/rollback then only user2 query will be executed.
So is there any solution, so that user2 should not wait till user1 commits/rollbacks...
Thank you,
SumanNaidu.S

suman never try giving the same probs in two threads
u won't get diff ans :)
i repeat
oracle does not allow dirty reads
and to keep consistency and concurrency
the user1 has to end his transaction
but yes u can always use nowait if u don't want to wait

Similar Messages

  • Will a sequence return same value for two different sessions?

    Is there a possibility that a sequence will return same value to two different sessions when it is referred exactly at the same instance of time?

    @Justin... Thanks for your insight; indeed, we too feel this shouldn't ever happen and never heard of it either, but there it is. (No, we haven't logged a TAR yet -- whatever that is -- partly because it didn't occur to us and partly because we only recently came across the issue and sensibly want to do some testing before we cry foul.)
    However, the code is pretty straight-forward, much like this (inside a FOR EACH ROW trigger body):
    SELECT <seqname>.NEXTVAL INTO <keyvar> FROM DUAL;
    INSERT INTO <tblname> (<keyfield>, <... some other fields>)
    VALUES(<keyvar>, <... some other values> );
    (where <tblname> is NOT the table on which the trigger is fired). This is the only place where the sequence is ever accessed. The sequence state is way below its limits (either MAXVALUE or <keyfield>/<keyvar> datatype size).
    In this setup, end users sometimes got an out-of-the-blue SQL error to the effect that uniqueness constraint has been violated -- as I said, we used to have a unique index on <keyfield> -- which leads us to assume that the sequence generated a duplicate key (only way for the constraint to be violated, AFAIK). We released the constraint and indeed, using a simple SELECT <keyfield>, COUNT(*) FROM <tblname> GROUP BY <keyfield> HAVING COUNT(*)>1 got us some results.
    Unfortunately, the <tblname> table gets regularly purged by a consumer process so it's hard to trace; now we created a logger trigger, on <tblname> this time, which tracks cases of duplicate <keyfield> inserts... We'll see how it goes.
    @Laurent... winks at the CYCLE thing Our sequence is (needless to say) declared as NOCYCLE and the datatype is large enough to hold MAXVALUE.

  • Use of SAP memory to transfer data between two different sessions.

    Hello experts,
    I wish to know how to use SAP memory to transfer data between two different sessions.
    The scenario is that when I run a report and change a variable, the value of changed variable should be availabe to another user on another terminal.
    Thanks & Regards!
    Sumit

    Hello,
    Just to add what Max has already mentioned. IMPORT TO / EXPORT FROM DATABASE statements can be used to store data in special "cluster" tables (you can't use any DDIC table) e.g., INDX.
    @OP: You can opt for Shared Memory(SHM) for this specific requirement as well. In my opinion SHM is a bit tricky to code, but it is easier to monitor. The opposite holds true for "data clusters".
    You should remember SHM is app-server specific. So if you've a load balancing scenario, using SHM can cause problems.
    Hope i'm clear.
    BR,
    Suhas
    Edited by: Suhas Saha on Nov 19, 2010 4:12 PM

  • Commit handling with Different sessions on same Database

    Hi,
    We have a requirement, where-in we have two modules working on the same database but different schemas.
    In this case, also the oracle session for both the module is also different.
    We want to ensure a two phase commit logic in this scenario, wherein the integrity of the data commit is maintained across sessions.
    How can I achieve the same, Because I have heard two phase commit works of Distributed database using DTC(Distributed transaction co-ordinator.
    Regards,
    Uravesh

    urvesh wrote:
    Hi,
    We have a requirement, where-in we have two modules working on the same database but different schemas.
    In this case, also the oracle session for both the module is also different.
    We want to ensure a two phase commit logic in this scenario, wherein the integrity of the data commit is maintained across sessions.
    How can I achieve the same, Because I have heard two phase commit works of Distributed database using DTC(Distributed transaction co-ordinator.
    Why do you think that the integrity of the data would not be preserved with the commit functionality ? What do you think two phase-commit does?
    Aman....

  • Deadlock when executing package simultaneously  from two different sessions

    I have written a package which will do the below tasks .
    package A
    Delete data which was older than one year from master table A and then populate data from stage table A to master table A .
    truncate summary table and populate the summary table from the master table .
    The package will be executed from a java application with the help of a scheduler in java. Some times, the packageA is still executing, while another instance of the package A is scheduled, that creating to deadlock in oracle. we can not use dbms_locks pkg in our application due to restrictions . i want to handle this situation from the db side in such way that the session B , need to wait until the session A completes the execution of the package . Can some one please tell how to handle this scenario in pl/sql?
    I thought of creating a function which will return the execution status of package A by reading a flag from temporary table . So that next schedule can be scheduled with the return status of the function. is there any other way other than this , so that i can pause execution of package A in session B and resume after session A is successfully executed
    create or replace pkg a
    populate master ;
    populate smry ;
    populate app_tables ;
    end pkg ;
    create or replace pkg body
    populate master()
    delete from master where loaddate < sysdate -365;
    loop
    fetch from stage a
    insert to master a
    end loop
    populate smry()
    truncate sumary a ;
    insert into smry
    select values from master ;
    populate app_tables()
    populate master;
    populate smry ;
    end pkg body

    I have a question about your requirements. I'm not questioning them just trying to understand them. You wrote:
    Delete data which was older than one year from master table A and then populate data from stage table A to master table A .
    truncate summary table and populate the summary table from the master table . If this is all there is to the requirement why would a second invocation be scheduled so soon? If you delete all data older than one year why would you need to do it again so soon?
    Notwithstanding the above you basically need a serialization management process.
    For all batch frameworks I have worked with we always include batch control and status tables to:
    1. guarantee that batches are run in the proper order
    2. allow for batch restart
    3. allow for suspension or termination of single batch jobs or job streams
    4. provide for reporting of batch statistics - batch run time, records processed, etc.
    5. simplify the testing of complex batch streams. Tests can be performed on any one batch step or any combination of steps by enabling/disabling flags in the control tables.
    6. eliminate the possibility of the problem you are reporting
    Using one or more batch control and status tables, in my opiinion, is the simplest and best way to serialize the batch jobs you are dealing. Such tables gives you maximum flexibility while placing the fewest constraints on the system.
    In the system I work with we try to have a clear line of demarcation between processes that control the work to be done and the processes that actually do the work.
    The processes that do the work never determine what data they work with; they are parameterized so that they are told what data to use. All they know is how to process the data that they are told to process. This makes it easier to scale to add additional 'worker' processes by having the 'control' processes break up the data into different batches and running 'worker's in parallel.
    I would suggest designing and implementing a control hierarchy to oversee the execution of the worker processes. This will be your serialization manager.

  • Two browser with same site having two different session

    Hai Experts................
    I have a problem that with session............
    when we logged in one site with our username and password, and
    then i try to log in same site with other username and password in another browser
    then how to know is there any browser is open with any other username and password in the same site.
    I want to give this checking in the client side.....

    You could use cookies, but this will only allow you to detect multiple uses of the same browser like two instances of IE. This won't work if you are using IE and you open another different browser such as Firefox.
    I think you are out of luck :)

  • [OBSOLET]Automatically logging in different sessions in KDM via kdmctl

    I recently found comfort in KDE, so I try to use KDM on my mediacenter to manage both, a KDE session, as well as an XBMC session.
    What I want to do: Log in as $USER on two different sessions, one with XBMC and one with the KDE desktop automatically on boot without the need to provide a password.
    After playing a bit with the control center, I came as far as automatically logging in a user and/or allowing a user a passwordless login. This is a good first step. I cannot, however, find a way to define the session it should use, the control center setting for auto login will always use the default session (which is the last session I manually logged in to). There is no way to configure multiple sessions at once in the controlcenter.
    So I looked for cli tools and discovered kdmctl. It has a number of features, for example will "kdmctl activate :1" jump to the display :1. Another step closer to my goal is "kdmctl reserve", which opens a new login prompt on the next free $DISPLAY. Now it seems like kdmctl is very session-sensitive. I need root access to call it from a tty, while a normal user is sufficient inside a KDM managed X session. Calling kdmctl in a tty will give me more options, than calling it in X, even with sudo. Upon "# kdmctl" in a tty, I can see resume, manage and login options, which are not there in a KDE session.
    What I have so far:
    1. I can use the KDE control center to log in a user automatically on :0, but I cannot specify the session (Plasma, XBMC, etc.).
    2. I can run "# kdmctl reserve" to create a new login prompt at :1
    3. I can login to :1 by issuing "# kdmctl login :1 now USERNAME PASSWORD", but only from a tty (which would be sufficient, as I intend to write a systemd unit).
    What I cannot do:
    1. I cannot specify the session. I have found http://docs.kde.org/stable/de/kde-works … opics.html, but it is not really helpful. It says I need "[session_arguments]" in the "format of printf specified .dmrc". I assume this is how I could specify my session, but I cannot find any documentation. Maybe I'm using the wrong keywords. There is neither a man page for kdmrc nor for dmrc. This is what I'd like to have some help with.
    EDIT: It's not actually solved but has become obsolete. KDE4 is fading away and, according to the wiki, KDE5/plasma5 prefers SDDM. Besides that, I stopped using KDE, stopped switching sessions, stopped working on this a long time ago.
    Last edited by Awebb (2015-03-29 11:55:33)

    Anybody any clues?
    -Mahendra.

  • Can you move files between two different user accounts in Time Capsule?

    I copied a bunch of stuff from my old NAS (which used FAT) to Time Capsule under one user account... I then reformatted the NAS to HFS+ so I could just use it as a USB drive connected to the TC. Now I realized that I want to have one of those folders in another user directory. I cannot open two different sessions of the TC on the computer...at least I have not figured out how to do this. Is there a way to accomplish this without copying the folder to my computer, then copying it back to the other user directory? It is several gigs.

    you can crop files from one account to another using the Public Dropbox which every user account has.  Log into the user that has the files you want to move, then drag the folder you want to the new users' dropbox:
    I suggest a small scale test on a few files first before moving gigabytes of files.

  • SBO - How to use two different Stock Account within the same Item Group

    Hi,
    I'm currently stuck within one of my implementation.
    I'm deploying the same solution worldwide which worked pretty well until now. All the items are connected to an item group, with a unique GL account, supposed to book at the same time the good receipt and the good issue (Balance-Sheet Account = 14xxxxx).
    My new unit is willing to use two different GL accounts when performing its stock entry (let say 14xxx10) and another GL account for the good issue, let say 14xxx20.
    Do you have any clue so i can please them and keep using at the same time the item group ?
    Thanking you in advance
    Stephane

    Hi,
    In fact, we use the GL account as the HQ Account (Reporting Account) while the "Export Code" will be used to store the local GL Account (greek account).
    As such, we can, somehow handle two different chart of accounts.
    In my reporting, i'm only using a single GL account for stock movements, while my greek counterparts want to handle two different accounts.
    Threfore, i have only two solution since there is normally a one to one relationship between a HQ account and a local account that are :
    1 - Duplicate the HQ accounts
    In that case, i do respect anytime the one to one relationship. I've got one HQ account for one local account. But how can i put this since i can only handle one single stock account.
    2 - I keep my single stock account like this but i won't be managing the possibility to get two different Export Codes.
    Regards
    Stephane

  • I have 2 copies of Firefox open (two different windows with lots of tabs), if I reboot can I restore both sessions?

    I have 2 copies of Firefox open (two different windows with lots of tabs), if I reboot can I restore both sessions? I am familiar with clicking history/ restore previous session, but don't want to reboot to let windows update to do it's thing unless I can restore both sessions.

    If they are running different profiles, then yes.

  • Problem: Sharing session between two different Web browser & Web Appn'

    I�m facing a strange scenario here and would appreciate any inputs which could resolve this issue.
    I have two webapplications (EAR�s) on two different machine and different WebSphere application server. I have �WebAppA� [on machine A, WAS A] which opens in parent window and expects to pass some info in the FORM submission with request parameter to �WebAppB� [on machine B, WAS B] which opens in a child window browser on clicking submit button from �WebAppA�.
    Now the WebAppA is required to wait till the response come from WebAppB after certain functionality and once the function of retrieval is over by WebAppB, it sent back the response data back to WebAppA FORM, which finally submits this form after getting the response data from WebAppB. Now the response to WebAppA [which is in machine A, WAS A] from WebAppB is a pure POST request on complete URL and set of request parameters with values.
    Now what is happening is that, when a User A fills the form on WebAppA and submits the data to WebAppB, on response it gets the data of some other User request, for example day of UserB or UserC.
    Now when I do the test on my development environment, where its just me or some other 2-3 users accessing it I don�t face any problem. I get the response for the request I have submitted�.PERFECT. On production I have issue where users are getting data as response of other users.
    I suspect since the response is submitted to the form page of WebAppA its unable to synchronize to which user it belongs to. May be that�s the reason when I test it on development with single or 2-3 users its behaving fine. I hope I could put my question properly to you. I don�t know what can resolve this or what is the actual cause? Is there a proper way to implement this? Please any suggestion or inputs are appreciated.

    Thanks Amittev,
    That's the problem for me. Actually this is a part of integration with third party application (which is loaded in child window - WebAppB). So as per the functionality there is no reference or trace of the user in the parent window at first instance. Anyone can come to parent window and initiatate a process. Its only when the data comes back from child window (which is the WebAppB), that parent window application (WebAppA) take the response and proceed further. Now here is what I'm facing problem. the user who initiated the process by clicking on the submit buttom of Parent window is not getting his response, but of some other user. This is not happening with every user and at all time. But were sparingly and rarely, but enough to bring headache to our department now.
    Now I suspect that, since there is a parent/child browser functionality here the session which is started by parent is not synced with child where the WebAppB is loaded and responds the response to WebAppA. The WebAppB makes a POST request submission to the WebAppA thru the child window and the session here is missing synchronization, I believe. I will appreciate some inputs and resolution to this problem. Thanks.

  • [svn:bz-trunk] 21394: bug fix for watson 2887837 Not getting duplicate session detected error when same flex client id is used from two different HTTP sessions in CRX .

    Revision: 21394
    Revision: 21394
    Author:   [email protected]
    Date:     2011-06-16 12:34:13 -0700 (Thu, 16 Jun 2011)
    Log Message:
    bug fix for watson 2887837 Not getting duplicate session detected error when same flex client id is used from two different HTTP sessions in CRX.
    get the sessions id before we invalidate the duplicate session.
    Checkintests pass
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/endpoints/BaseHTTPEndpoint.java

    For our profect I think this issue was caused as follows:
    Believing that remoting was full asynchronous we fired a 2 or 3 remote calls to the server at the same time ( within the same function ) - usually when the users goes to a new section of the app.
    This seemed to trigger the duplicate http session error since according to http://blogs.adobe.com/lin/2011/05/duplication-session-error.html  two remote calls arriving before a session is created will cause 2 sessions to be created.
    Our current solution ( too early to say it works ) is to daisy chain the multiple calls together .
    Also there seemed to be an issue where mobile apps that never quit ( thanks Apple! )  caused the error when activated after a few hours.
    I guess the session expires on the server and the error above occurs on activation.
    So the mobile apps now ping the server with a remote call when activated after sleeping for more than one hour.
    All duplicate http errors are silently caught and reported.
    Fingers crossed we won't get any more!

  • Handling two transactions in session method at a time

    Hi frnds
    now im facing problem in handling two transactions in session method fs00,fspo
    at a time.
    i want some info.on how to handle two transactions at a time
    thanx

    Use the function module in the following sequence.
    BDC_OPEN_GROUP.
    BDC_INSERT. " for the first TCODE
    BDC_INSERT. "  for the second TCODE
    BDC_CLOSE_GROUP.
    This will solve your problem.
    Reward if helpfull.
    Thanks and regards,
    Veerendranath Maddula.

  • How to handle transactions when two different databases are involved.

    consider two tables namely Table-A and Table-B part of two different databases namely ORACLE and MYSQL.
    Now the project requirement is updating the Table-A(ORACLE) and Table-B (MYSQL) as one transaction. i.e. either update both the tables or rollback both the tables.
    Now my question is how could i handle this situation using JDBC(Type-4) driver.Because i think at a time only one JDBC driver can be loaded into the JVM.

    NareshAnkuskani wrote:
    Now my question is how could i handle this situation using JDBC(Type-4) driver.Because i think at a time only one JDBC driver can be loaded into the JVM.No, that is not true.
    But anyway, you need to use distributed (XA) transactions. i believe that the latest version (5.0) of mysql actually has support for XA transactions. you need to use a to setup a distributed transaction and attach the connections for the two databases to that transaction. then it should function as you desire.

  • How to handle an update of the same record from two different user JSP

    how do you handle an update of the same record from two different users in JSP... if one person updates the record from one drop downs should be updated as well.. is the possible.

    I'm not sure whether I understand your question. If one user changes a record then you would like other users to see those changes. Normally those changes will be visible to other users when they refresh their browser, after the first user has committed changes to the record. I you want to be sure that the same row isn't updated at the same time by to different user, you need to configure some locking (pessimistic locking) - this depends of what technology you use. In EJB3 pessimistic locking is performed by adding a version to every entity object. If you are using ADF, the framework is able to handle either pessimistic or even optimistic locking.
    If you want the changed row to be updated in other users browsers without any user interaction by these users, you should take a look at Reverse Ajax (ex. DWR http://ajaxian.com/archives/reverse-ajax-with-dwr) - or Ajax in general. But you will never get a realtime solution, where changes is visible in other users browsers right after each record update.

Maybe you are looking for

  • Need help setting up Powerbook G4 to Belkin Wireless G Router 802.11g

    Cannot get the laptop to go online, says "the specified server could not be found. Called my internet provider, Belkin and no one can get it online. Can anyone give me the steps to setting up the laptop maybe the settings are not right? I bought an a

  • Network settings drop down box won't go away without force quit.

    When I click on network settings for any reason a drop down box appears that says "Your network settings have been changed by another application". The only option given is to click "OK". When I click "OK" the box goes up and immediately comes back d

  • How do I save my Prel file as a .MOV file or other movie file in Prel 12?

    I'm trying to upload an edited video to YouTube I made in Prel 12 but it had an error when I tried to share it in Prel but it said the video was too long even though my video was only 4 minutes long. So how do I fix that or save my project under some

  • Swfs don't run locally

    I've created a master Captivate file that calls on multiple swf files, together creating a demonstration that runs 18 chapters of content. I have embedded the published captivate movie in an html page. The movie is set in an html page so our customer

  • How to detect threshold voltage from xy graph?

    I am making labview program for analysing VI characteristic of diode. I want to show forwardbiased breakdown voltage automatically in xy graph or textbox. Is there any method for detecting breakdown voltage either through graph or some mathematical c