Cmp exclusive locking

hi, is it possible to implement exclusive locking in cmp 2.0 ?
just like FOR ... UPDATE statement in oracle ?
help please

After having discussion with Mitesh, here is what we think
There are 2 ways to handle this issue
Approach 1:
Using UserTransaction in the servlet
ut = (UserTransaction) ic.lookup(
"java:comp/UserTransaction");
ut.begin();
findAll();
doProcessing();
ut.commit or rollback();
In this case all rows will be locked till we do commit or rollback
Approach 2:
Using BMT/CMT (Bean Managed Transaction/ContainerManagedTransaction) for session bean as a middle layer between servlet and CMP
For CMT in session beans
Now session bean will have a business method(having Required transaction attribute in CMT) doing
busineessmethod() {
findAll()
doProcessing()
BMT in session bean is similar to UserTransaction explained in servlet, only difference in getting usertransaction
For BMT , we need to do
context.getUserTransaction();
Please refer to samples/transaction samples for details

Similar Messages

  • GTT table getting Row Exclusive lock

    I have a procedure which loads a table which is used for reporting.
    Currently it is a single process which picks up most of the data after joining 2-3 big tables(around 70-80GB) and then loading the main table.
    The joins are on PI and also partitions are also being used. Then a lot of updates are done on the main table to update other columns which are being picked from different tables.
    As the processing is happening on huge amount of data(around 1M), so processing is taking a lot of time.
    This process is taking around 40-45 minutes.
    I am planning to use parallelism to run it in 75 sessions. So the initial big insert will be faster and later on all the updates will be done on smaller chunks which will benefit the performance.
    I planned to use GTT table so that i dont have to create 75 temp tables for each sessions.
    But while using GTT table(ON COMMIT DELETE ROWS) in parallel sessions, i am seeing that the GTT table is getting Row Exclusive lock and the time taken by overall process is increasing by lot.
    So i tested by using 75 temp tables. There i saw that the performance has increased by lots as assumed initially.
    Please let me know if there is any other way or how to remove the locks on GTT table.

    First you should question why you think you need 75 GTT.
    Also your question contains no useful information
    (no four digit version of Oracle, no OS, no number of processors) , this paragrah
    Currently it is a single process which picks up most of the data after joining 2-3 big tables(around 70-80GB) and then loading the main table.
    The joins are on PI and also partitions are also being used. Then a lot of updates are done on the main table to update other columns which are being picked from different tables.
    As the processing is happening on huge amount of data(around 1M), so processing is taking a lot of time.
    This process is taking around 40-45 minutes.tells nothing,
    so basically your questions boils down to
    - Hey I come from a sqlserver background (this is just an educated guess), how can I find a workaround to wreck Oracle to make it work like sqlserver.
    75 parallel sessions on say 4 to 8 processors is a very bad idea, as these sessions will be simple competing for resources.
    Also a row exclusive lock is just that: a row level lock. This isn't a problem, usually.
    Sybrand Bakker
    Senior Oracle DBA

  • Failed to acquire exclusive lock on client session - Webdynpro

    Anyone experience this below intermittent error on Webdynpro - e.g. Display Leave Summary functions ?  If user retry/revisit the same screen again. it will be working fine.
    Having some hard to to get thread dump at those short and intermittent moment.
    Any suggestions are welcome.
    Found this note below but doubt it will help at this moment.
    Web Dynpro error page, known error situations, error codes
    SAP Note Number: 1113811 
    NW/EP 7.0 SPS13
    #2#sap.com/pb/PageBuilder#com.sap.tc.webdynpro.services.session.LockException: Thread SAPEngine_Application_Thread[impl:3]_21 failed to acquire exclusive lock on client session ClientSession(id=(J2EE11441500)ID1662520351DB00529024001059157699End_1898143411). Existing locks: LockingManager(ThreadName:SAPEngine_Application_Thread[impl:3]_21, exclusive client session lock: ClientSessionLock(SAPEngine_Application_Thread[impl:3]_16), shared client session locks: ClientSessionSharedLockManager([]), app session locks: ApplicationSessionLockManager([]), current request: sap.com/pb/PageBuilder).Hint: Take a thread dump of the server node to find the blocking thread that causes the problem.
         at com.sap.tc.webdynpro.clientserver.session.ClientSession$LockingManager.lock(ClientSession.java:1511)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:233)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:150)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

    Hi,
    Check this,
    ESS SC Import Problem
    Thanks and Regards,
    gopal.sattiraju

  • Failed to acquire exclusive lock on client session ClientSession

    HI all.
    when I login the Portal as a MSS role,I want to see about the data of employee(about 20000 employee).
    some page can't open succeed.The error:
    500   Internal Server Error
      SAP NetWeaver Application Server 7.00/Java AS 7.00 
    Failed to process request. Please contact your system administrator.
    Error Summary
    While processing the current request, an exception occured which could not be handled by the application or the framework.
    If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
    Root Cause
    The initial exception that caused the request to fail, was:
       com.sap.tc.webdynpro.services.session.LockException: Thread SAPEngine_Application_Thread[impl:3]_27 failed to acquire exclusive lock on client session ClientSession(id=(DSAPBPRD_DPP_01)ID2006199550DB11722229503911854949End_53412655). Existing locks: LockingManager(ThreadName:SAPEngine_Application_Thread[impl:3]_27, exclusive client session lock: ClientSessionLock(SAPEngine_Application_Thread[impl:3]_29), shared client session locks: ClientSessionSharedLockManager([]), app session locks: ApplicationSessionLockManager([]), current request: sap.com/pb/PageBuilder).Hint: Take a thread dump of the server node to find the blocking thread that causes the problem.
        at java.lang.Throwable.<init>(Throwable.java:56)
        at com.sap.exception.BaseException.<init>(BaseException.java:145)
        at com.sap.tc.webdynpro.services.exceptions.WDException.<init>(WDException.java:61)
        at com.sap.tc.webdynpro.services.exceptions.WDException.<init>(WDException.java:54)
        at com.sap.tc.webdynpro.clientserver.session.ClientSession$LockingManager.lock(ClientSession.java:1511)
        ... 20 more
    Edited by: cui joe on Jun 16, 2009 5:36 AM

    HI,thanks very much.
    Because our data is very huge,so some leader login the system will get the error.I check the st22,It realy found the error:
    Time limit exceeded.
    The program "SAPLRHDB" has exceeded the maximum permitted runtime without
    interruption and has therefore been terminated.
    If I should increase the system profile parameter "rdisp/max_wprun_time"?
    Can else I should turn other parameter?

  • Error: the database could not be exclusively locked to perform the operation in sql server 2008 ?

    I am trying to rename the database but i am getting below exception while doing it-->
    Error: the database could not be exclusively locked to perform the operation.(Microsoft Sql Server,Error 5030)
    Thanks.

    as mentioned earlier by both these users just wait for all the connections to go and then try- it will succed
    or else if it is dev\Uat environment & you can kill the conenctions - make the changes (use this as last option)
    i was just wondering if you are connected to the same DB? If yes change your context to master(means connect to master DB ) and then issue this command.
    Sarabpreet Singh Anand
    Blog ,
    Personal website
    This posting is provided , "AS IS" with no warranties, and confers no rights.
    Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

  • Loadjava hangs - exclusive lock on sys.javasnm$

    We upgraded from Oracle 9.2.0.4 to 9.2.0.5 (using export then import of the entire database) and have found that our user java classes that compiled fine in 9.2.0.4 aren't as lucky in 9.2.0.5. When we use "loadjava" to recompile the jar files, some compiles are successful and others hang. When we investigate the "hanging" ones we find an exclusive lock on sys.javasnm$. The only session doing a loadjava compile is mine. We kill the Oracle session, the exclusive lock goes away, we compile a few more jars successfully, then the "hanging" begins again. Can anyone explain what is going on? Thanks in advance.

    Solution - We were missing the DROP SYNONYM permission for the Oracle User we were importing the java code for. Once that was in place the locks were no longer an issue.

  • Read exclusive lock  FileInputStream

    I would like to read a object from a file , how can it lock the file or read the file as exclusive lock?

    FileInputStream.getChannel().lock()when this method is called, does that ensure that no other application, java or otherwise can open/delete this file?

  • IllegalStateException thread tries to release exclusive lock LockingManager

    Hello,
    I'm having this error,
    java.lang.IllegalStateException: Illegal state: thread tries to release exclusive lock on ApplicationSession which it hasn't acquired! Details: LockingManager(ThreadID:89, threadName: HTTP Worker @1298613650, session lock: null, current request: company.com.pe/wd_hrsolmovpil_v1/Wdhrsolmovpilv1)
    Any of my web dynpros, even the uwl doesn't work.
    This happened after I tried to deploy project. Everything was working fine, but now ... I have this. I've restarted the server, but nothing happens.
    Please, anyone knows how to solve this? Any ideas?
    Regards
    SU

    Hello,
    The problem was because the WAS has the parameter DefaultExpirationTime seted in -1 of all the Web Dynpros (sap.com/tcwddispwda). It only accepts positive values. I had to login through Telnet and execute the parameter,
    add webdynpro
    MANAGE_WD_APP_PROPS sap.com/tcwddispwda
    Thanks & Regards
    SU

  • Updating  a  row  in  table  exclusive  lock on entire table

    Hi
    We have table master table and few child tables .
    when we try to update a row in master table , it is locking entire table
    i.e seems update process holding exclusive lock on entire table
    it is not allowing any furthur update to that table
    Could you please tell me what could be the problem for that
    Thanks,
    - AK

    Does the table has primary key - foreign key relationship? Try disabling the constraint and see if it works. If it works then it is about unindexed foreign key issue.

  • Monitor exclusive lock on a table and send notification email through EM

    Hi,
    I have Oracle10g and EM10G running on different servers.
    now one of my plsql code creates an exclusive lock on one of my tables.
    i want to monitor this exclusive lock on this table through the EM. and when the exclusive lock on the table is continuing for more than 1 hour, i want an email notification sent to me by the EM.
    How can i do this?
    Can someone help me achieve this above situation.
    Thanks.
    Philip.

    One of the nice about OEM is that a lot of the things are self explanatory. E.g. I never read docs to set up our first user defined metrics. It is really just to dive in there. Define a metric and the sql you want to use for monitoring the lock. Then you just go and create email notification for this when it hits warning or critical treshold.

  • Can not get exclusive lock on the shared drive of Azure file storage

    One of my application need exclusive access on the data folder where it writes the data.
    I have setup data folder in Z drive which is shared drive of Azure File system.
    The application is not able to get the exclusive access on the data folder and throws IO exception.
    Is that not possible with shared drive of azure file system

    Hi Subodh,
    You could refer the following link for details on how pessimistic concurrency (Exclusive lock) managed in Azure Storage:
    http://azure.microsoft.com/blog/2014/09/08/managing-concurrency-in-microsoft-azure-storage-2/
    Please be advised that an Exclusive lock on an Azure File Share is not possible using REST Protocol and need to be done using the SMB Protocol.
    You could refer the following link for details on how to manage SMB File locking:
    https://msdn.microsoft.com/en-us/library/azure/dn194265.aspx?f=255&MSPPError=-2147217396
    Hope this helps.
    Regards,
    Malar.

  • Dont want exclusive lock on Shared Object

    Hi,
    I have created a shared object, but by default it seems to be having exclusive lock. I want it to work so that it should be possible to add data or delete data from it by anyone anytime without any locking. Please let me know how I can do this. Is there some property I need to set?
    Thanks for reading

    Yes I have already created shared area and everything is working fine. I have the following statement
    myshmhandle = zsd_zvi2d_area=>attach_for_write( ).
    This statment locks the area handle and if another program or another user tries to again execute the statement above it gives and exception. CX_SHM_EXCLUSIVE_LOCK_ACTIVE. I want it to work in such a way that locking doesnt place at all. Because the way I m adding and removing data, its with a unique key so there is no chance of one instance or user overwriting other persons data

  • Why no exclusive lock for conventional path loading for SQL*Loader?

    why no exclusive lock for conventional path loading for SQL*Loader?
    it use insert statement so it should use exclusive lock right?
    thanks

    ok, so only update statement would put a lock but not for insert statement?
    because I have seen a situation where a user update rows in a sesssion (without commit) prevent another user update the rows.
    thanks

  • Ingres vs Oracle exclusive locking

    Ingres allows an exclusive lock on tables, set lockmode on tablename where readlock = exclusive which means the users can't access the same
    rows that are being modified by another query.
    Is there anything in oracle that does the same thing ? All of Oracle's locking seesm to be that you can
    still read data. And that is what my user is afraid of. He doesn't want to read old data, when it's
    being changed.
    How do you work around this ?
    Thanks.

    Ingres allows an exclusive lock on tables, set lockmode on tablename where readlock = exclusive which means the users can't access the same
    rows that are being modified by another query.
    Is there anything in oracle that does the same thing ? All of Oracle's locking seesm to be that you can
    still read data. And that is what my user is afraid of. He doesn't want to read old data, when it's
    being changed.
    How do you work around this ?
    Thanks.

  • Shared lock vs exclusive lock

    Hello
    I have a question.
    If we have two scott sessions. I am updating a table EMP in session 1. It means it is exclusively locked.It cannot be used by session 2. Then can we use select command on table EMP in session 2.?? This command shoul not work according to me. But it is working.
    Reply me.
    Thanks in anticipation.

    984426 wrote:
    But in shared / exclusive lock, we have a property that we can't acquire shared lock on data if it is exclusively locked and vice versa. that means readers block writers and vice versa.
    E.g. if T1 is updating a row then how T2 can read that row? If T2 is reading then that is inconsistent data as it will pick the non-updated value of that row until T1 commits.
    Please explain.
    I am having doubts in this topic.
    ThanksYou need to check back again the basic concepts from the Concepts guide. Your understanding about the Oracle's working is completely wrong.
    In Oracle, the Transaction Isolation Level is set to Read Committed . This means any kind of inconsistent data is not possible to be read by you and for that data , Oracle would create for you a consistent image using the Undo Blocks in which the old image is going to be stored till the time that transaction is not over( and even after that too for some time with conditions apply) . So if T1 is updating a row, T2 can't lock the same row as it would be locked exclusively and the S1 (another select) would be seeing an old and consistent image of that change only as long as it's not committed. What you said doesn't and won't work ever in Oracle.
    Read the first link that's given to you already.
    Aman....

Maybe you are looking for