A string of question about Locking & Isolation Level

Hi All
It is highly appreciated if someone give offer answers to my below questions
1) There are two ways of locking mechanism: Pessimistic & Optimistic. In general, do all J2EE app server support all these two ways of locking ?
2) It seems to me that setting the isolation level to "serialization" should result in using pessmistic locking. If no so, please point out my misconcept and explain to me.
3) Are there any differences in the way of entity bean programming as different locking mechansim is adopted ?
4) With regard to optimistic locking, will the app server throw out exception as data contention is detected ? Is the way of handling dependent on app server? Or It is transparent to the developer of entity bean. Please give me an e.g of j2ee app server product how to handle this scenario.
5) To adopt the approach of "optimistic" locking, do l have to implement it on my own using bean managed entity bean.
6) It seems to me that optimistic locking can achieve better concurrency. If it is inherently supported by app server for its container managed entity bean (=> totally transparent to the developer of entity bean). Is it always the rule of thumb to config the server to use "optimistic" locking instead of "pessimistic" ?
Sorry for bombarding you guys with such long list of questions. l would be very thankful if someone can help me consolidate my concept on these topics.
Also, please send your reply to [email protected] as well
thanks & regards
Danny

Hi Danny,
I became interested about the optimistic locking recently. If the topic is not long forgotten then this may make some difference!
We have attacked the optimistic locking issue by introducing audit fields (MODIFY_BY_USER, MODIFY_DATE) in tables where concurrency needs to be implemented.
We are retrieving rows from the table (for display or update) through Stateless Session Bean using simple SQL SELECT. The audit fields are fetched along with the business data and are kept at the client. While any of the concurrent users tries to update the row the audit fields are sent to the application server along with the modified business data. The relevant Entity Bean checks for any difference in the timestamp of the audit field (MODIFY_DATE) value with the value in the database. If a mismatch is found it reports a business exception to the user. Otherwise, the row is updated with the lastest timestamp value in the audit field MODIFY_DATE.
This works fine when two update operations are not concurrent, i.e., two users submit their update requests in a time lag greater than the time taken by the transaction to complete. This alone could not prevent the dirty update on the database.
Hence, to prevent any concurrent update contending for the same row you need to set the following ejbgen tag in the Entity Bean:
concurrency-strategy = Exclusive<<<<<Note: We are using Weblogic 6.1 with SP4 and CMP (no BMP).
Please let me know if you have got a better solution to tackle this issue.
Chandra.

Similar Messages

  • About Transaction Isolation Levels...

    Hi Everyone,
    Please, i have a couple of questions regarding the Transaction Isolation Level, i will really appreciate any help on this...
    1.- It is possible to know the transaction isolation level of all connections to the DB.??.. something like a select from v$session...
    2.- I have an application that manage it's own connection pool and have set all of its connections to Transaction_read_commited. The problem is that for some reason, sometimes we get the "ORA-08177: can't serialize access for this transaction." Error. But what i know is that this ORA-08177 error only happens if the transaction isolation level is set to TRANSACTION_SERIALIZABLE. How can be that possible??. There is another application running that points to the same database that maybe uses TRANSACTION_SERIALIZABLE connections but even if this is happening, why the error is happening with my application!!?. Both applications are running on the same weblogic application server with oracle thin jdbc driver... (Oracle 9i)
    Thanks in advance...
    Victor.

    thanks for the answers guys... i was reding several articles by Tom and also looking into Metalink documents... but my concern or my million dollar question is still: if exists the possibility to get the ORA-8177 error, even if i'm using Transaction isolation level READ_COMMITED???... what i learned from this articles is that if i use the Transaction SERIALIZABLE i may have this ORA-8177.. otherwise i wouldn't. right?... and if exists bugs related all that bugs may exists only if i define my connection as TRANSACTION_SERIALIZABLE.
    I'm pretty sure that in my application ("Application A") i'm not using any TRANSACTION_SERIALIZABLE connections.... but i'm afraid that the other application ("Application B") is causing some blocks or conflicts with "Application A"... Is that possible?? (i think that in theory it's not)... But still if that's possible.. i return to my question... Why that ORA-8177 error raises on my "Application A".... this kind of error must be raising only in the "application B"....
    Well maybe is something confusing.. an maybe is totally related to some developing mistake.... i just wanted to confirm some other point of views....
    thanks again!!..
    Victor

  • Question about setting track level

    Hi I finally got my new macbook pro and moto 8 pre and have just today tried a bit of recording just to get used to it. I am at the moment using garage band. I have a question about track levels. In Garage Band when I select a track to record there is a slider for input level or an option of clicking the automatic level control. But for some reason they are both just that color of grey you get when something can not be selected on a computer. How do I activate this? It's strange as I did actually manage to record the track, I just can't seem to really adjust the level. I thought maybe it has to do with the motu and I can only select the track level there, and that garage band level setting are (rightfully) disabled? Maybe that's what I should be doing, but just a bit confused. Anyway, thanks in advance for whoever takes the time to help out a newbie.

    Ah, ok. Good to know. Thanks for the info.

  • Question about locking order during merge statement

    Dear all.
    I have a merge query with a decedent hint to prevent deadlock with another queries.
    Another queries use select ~for update with same hint.
    My question is that the locking order will follow the hint in this query?
    Or I might use the select ~ for update before this merege.
    Please give any advice about select ~for update and locking order in the query.
    Thanks.
    MERGE INTO  A
    USING
         (SELECT /*+ index_desc(C index_key) */ *
         FROM
             C
          WHERE key > :start and key < :end
        ) B
         ON  ( A.KEY = B.KEY )
    WHEN MATCHED THEN
         UPDATE
         SET A.v1 = B.v1

    What you are doing is not going to prevent a deadlock in your, as yet, unknown version of Oracle. Reading an index does not cause deadlocks. Trying to alter an uncommitted row does.
    I would suggest you code this correctly by doing a SELECT FOR UPDATE WAIT <seconds> in all transactions.
    http://www.morganslibrary.org/reference/deadlocks.html#dlfu

  • Two basic questions about locks in Oracle.

    Hello,
    This is about 9i and onwards.
    I need to develop a comprehensive analysis of locks and waits and while doing so, following questions popped up.
    1) What is the difference between locks and waits?
    2) There is a DBA view called DBA_BLOCKERS. The standard Oracle documentation has only one line comment about this view i.e. "DBA_BLOCKER – Shows non-waiting sessions holding locks being waited-on by other sessions.
    My question is : Why would a non waiting session hold locks after all? I guess that automatically repeats the question #1 from above, What is the difference between "being waited on" v/s "holding locks with wait" and "holding locks without waits"?
    Thanks,
    R

    1) What is the difference between locks and waits? Lock - something you queue up to get and simply wait until it is available
    Waits - Waiting for a Specific event to happen before it can proceed.
    Re: Difference between a latch and a lock
    2) There is a DBA view called DBA_BLOCKERS. The standard Oracle documentation has only one line comment about this view i.e. "DBA_BLOCKER – Shows non->waiting sessions holding locks being waited-on by other sessions.DBA_BLOCKERS displays a session if it is not waiting for a locked object but is holding a lock on an object for which another session is waiting.
    HTH
    -Anantha

  • Question about Ap isolation...

    I have a WRT54GS,  ad all works fine with it. I have recently obtained an old laptop that I installed with a wireless PCI card. Once in a while, if I have both laptops online at the same time, both get timeouts on packets. I was wondering if setting AP isolation to 'active' would help with this. 

    While Leo technically answered your question with regard to FlexConnect, be weary of the fact that you will need to have local switched WLANs if you plan on having them available on controller failure:
    FlexConnect Backup Scenario
    WAN Down Behavior (Bootup Standalone Mode) (Can't Contact WLC)
    Central Switched WLANs will shutdown
    Web-auth WLANs will shutdown
    Local Switched WLANs will be up :
    Only Open, Shared and WPA-PSK are allowed.
    Local 802.1x allowed with local authentication or local RADIUS
    Unsupported featuresRRM, CCKM, WIDS, Location, Other AP Mode, NAC.
    For the full list of supported features using central/local switching view the following feature matrix:
    http://www.cisco.com/c/en/us/support/docs/wireless/5500-series-wireless-controllers/112042-technote-product-00.html

  • Question about locking certain folders w/diff.accounts?

    I'm about to let my girlfriend use my Mac, so I made a seperate account for her. I just don't want her going through all of my files and " stuff ". Is there anyway to lock certain folders in my account? I tried using parental controls but didn't find the file I wanted to Lock in the options.

    Hi Aaron
    When your girlfriend is logged in on her account your folders are locked to her. Your Home folders are only accessible from your account.
    Matthew Whiting

  • HELP! Question about "Locking" ipod

    I am an elementary teacher that is trying to get ipods integrated into the school curriculum, school administrators have expressed concerns about students putting inappropriate content onto the ipods, is it possible to "lock" unauthorized editing on an ipod, possibly password protection, or only allowing it to be updated on one cpu?

    No, it's not possible to do what you want.
    There is a screen lock that locks the iPod so another user can't use it without a code being entered, but this would lock the whole iPod.
    There's no way to selectively lock specific content, either adding it or viewing it.

  • Question about lock

    Hi all,
    I would like to know what table/object is locked during a goods movement?
    And also, can I lock a batch? If yes, what FM can I used to check whether a batch is being locked or not?
    Thanks in advance.

    Hi,
    If you want to check lock entries for the table, just go to tcode SM12, it will show user level.
    Regards,
    CS

  • Question about lock switch for smart phones

    i would like to ask about the lock switch for smart phones like Nokia 5800 Xpressmusic or Nokia 5230.
    Will the lock switch loosen if we always slide to unlock it?

    i used my 5800 for 11 months and it didn't happen at all
    -you can show appreciation to my posts if it helped or useful by pressing the green Kudo star beside my post that hepled
    -if my answer was the solution , so click accept as solution button
    Started From Nokia 3310 , Now with Nokia N97 v.22.0.110 + N900 PR1.2

  • Question about an entry level java programmer

    i was curious that if i do find a job in java as an entry level what kind of programming can i expect? i am sure some of the members over here were hired as an entry level. can you share your ideas with me? like any projects etc...

    What is your background in education? I don't know how much you know of Java, but that won't be the only thing they base their choice on. You barely ever have a project that uses exclusively java. Make sure you know basics of working with databases, different operating systems...
    The most important thing is that you can sell whatever you know as usefull for the job they have for you! Prepare yourself well for an interview. If you have the time, picture the type of work you expect from a vacancy. Ask yourself what technologies will be needed for that particular job and make sure you do at least know a little about them. Make sure you adapt your responses to the type of interviewer, type of company. In addition to that, don't tell people you know more than you do!
    Get some understanding on OO concepts.This would be a very important thing for some, but totally unnecessary to others. For me this is quite important! If your interviewer is a manager type, he won't be able to follow what you're talking about if you start talking about design principles! If your interviewer is a techie, then this is a good thing to show.
    JCP certification would be handy..From my experience this isn't a minimum requirement to get in. If the company values certificates, you can always use it afterwards to prove your dedication and get a raise once you're in. ;-)
    Further knowledge in Web components and Enterprice components (eg EJB) will be pluses.Again viewed from the 'make it sellable' side. If you come bragging that you're a Spring expert and your company is against open source frameworks, that won't be a point in your advantage.

  • Question about Sound Isolation/Reduction and Heat

    Hi all,
    My AGP Sawtooth G4 tower is loud
    -OWC 1.4 Ghz upgrade w/ fan
    -8500 vid card w/ fan
    -OEM fan
    -Seagate Barracuda 160 GB (loud!) + two other HDs.
    i haven't measured the decibel level, but it is significant.
    I do some home-audio-recording, and I want to know if I build/use an enclosure to seal in the noise, will excessive heat be a problem.
    thanks in advance
    Sawtooth g4   Mac OS X (10.4.6)   1.4Ghz upgrade, 896 ram

    re: the amount of noise reduction...any would be great. Didnt know it (or think about it) when i bought it, but the upgrade Seagate Barracuda HD is apparently notorious for being pretty loud. then throw in the 1.4 Ghz OWC processor upgrade (has a fan instead of a heatsink on the chip). those two + the stock fan crank some noise.
    the tower is in a computer desk now (cheap officemax type command center) - in the 'computer spot' behind a door. i'm tempted to just seal the box and put up soundproofing foam inside...but heat becomes a concern. i'll look into a fan, that seems like the logical(smart?) thing to do.
    Sawtooth g4 Mac OS X (10.4.6) 1.4Ghz upgrade, 896 ram

  • Question about Lock Duration

    Hi,
    I found a description at this link.
    http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/content.htm
    'At the end of an SAP LUW, you should release all locks. This either happens automatically during the database update, or explicitly, when you call the corresponding dequeue function module. Locks that are not linked to a database update are released at the end of the SAP transaction'
    I don't understand this, because I tested using commit work and wait. The lock entry still there after the statement 'commit' executed. the lock entry disappeared when the whole task completed.
    don't know what does happens automatically during the database update. Isn't the 'commit' the case they mentioned?

    So does that means even I using a SYNCHRONIZE commit. There still not a database update happen?
    From help.sap.com:
    For 'commit work' "It triggers a database commit that also terminates the current database LUW and closes all database cursors. "
    Database commit <> database update ?

  • Question about setting guitar levels

    Hi, I'm new at Garageband so bear with me. I just bought an Avid Recording Studio Fast Track USB interface to hook up my guitar. It's got 3 knobs on the top- Mic Gain, Guitar Gain and Output. (Mic Gain is for the XLR input, Guitar Gain for the 1/4 inch input, and then the output). When I hook it up in Garageband and click on the back of an amp, the recording level slider is grayed out and I can't adjust it. How do I get the proper guitar level so I'm getting maximum sound with no noise and no clipping? Do I adjust the volume slider on the track? I assumed that was just for volume and not the actual recording level.
    Any help is appreciated, thanks!

    xSlamx wrote:
    the recording level slider is grayed out and I can't adjust it.
    http://www.bulletsandbones.com/GB/GBFAQ.html#volumesliderdisabled
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    I assumed {the track fader} was just for volume and not the actual recording level.
    correct

  • Question about locking down IIS on an SCCM 2012 distribution point on a Windows Server 2003

    Hello. My environment is SCCM 2012 SP1. I will be setting up several distribution points on Windows Server 2003 machines. This summer I have a project to configure SCCM to use our PKI infrastructure. Unfortunately, this will not be in place before I need
    to set the Windows Server 2003 machines up as distribution points. I am not an IIS expert. When I set the DPs up, I am only 1)Installing IIS, 2)Enabling BITS extensions, and 3)Enabling WebDav. Is there anything I should do to ensure they are as secured as
    possible?

    I would say that installing Windows Server 2003 is not "as secure as possible" due to it's end of support coming soon.
    http://support.microsoft.com/lifecycle/default.aspx?LN=en-us&p1=3198&x=10&y=12
    And I would say that we need more information about your scenario to tell you how it is as secure "as possible". Since that would be shutoff at the bottom of the ocean. But that wouldn't be that useful server.
    Im guessing that you will run these servers for internal
    clients ONLY. And that you have a decent edge protection as well as physical protection. Then I would start by having the lastest secrutiy patches, running antivirus software and having the firewall turned ON. I would make sure that
    only necessary logons would be possible and that the servers wouldn't cache any credentials. Typically a DP NEVER holds sensitive data so no real need to secure them more than that in a normal scenario if you ask me.
    A final notice, this is a baseline
    for a common scenario. You would need to scale and change that
    in order to apply for your scenario.
    Tim Nilimaa | Blog: http://infoworks.tv | Twitter: @timnilimaa

Maybe you are looking for

  • Cannot find the driver software for my printer hp 1515

    First i found it..but then i realized that it for hp 1510 printer,so i had stopped the download. but then, itry again to download but it not show the dowload for software, it only show the utility download. what should i do? i need the driver softwar

  • Windows live messenger on mac

    is there a way to operate the newest version of windows live messenger on the mac? if so, where can I find it?

  • MACBOOK PRO ASKS FOR PIN TO UNLOCK THIS

    I bought macbook pro from some one and I was not aware that it can be stolen macbook because bag and original charger was with mac,so my question is that I used 3 days and the owner has blocked the mac because whenever I turn on there is a msg enter

  • Benefit of compiling with "-g:none"?

    I've done some archive searching for this, but I didn't find anything definitive. The question is, is there any significant benefit to building a system with "-g:none"? I can see it causes a slight reduction in class file sizes, but it's not clear wh

  • FileSystemView.getRoots() doesn't return C:\ D:\ etc

    Anyone know why this might be? I am on Win2K/XP, I see c:\MyDocuments\user\ as the only root value coming back. So another idea, would it be possible to try C:\ d:\ etc and call isRoot() on it, and if it returns true, add it to the list of roots?