What are the consequences of ServerSession.removeFromIdentityMap()

We have external processes that update the data in our database. As a result we must invalidate and/or refresh portions of the ServerSession's identity map when these external changes are committed to the database.
Given the following situation:
A process initiates a query through the toplink ServerSession. The objects from that query are cached by the ServerSession's identity map. This process then begins a transaction through a UnitOfWork to update an Object (TestObject). During this transaction an external process updates data in the database that our TestObject represents. The TestObject is removed from the ServerSession's identity map through ServerSession.removeFromIdentityMap( Object ourInstanceOfTestObject ). When the transaction from our UnitOfWork is committed, what happens?
Is the UnitOfWork operating on a clone of the object in ServerSession's identity map or is it operating on a reference to that object?
Any light that could be shed on this would be greatly appreciated.
Thanks,
Andrew Lee

Hmmm... I just did a quick test case, and it looks like at commit time TopLink updates the object you removed from the identity map, and even politely puts it back into the cache.
Make sure you have an optimistic locking policy, or you're going to get last one wins on the database. I can't comment if this is deterministic behavior between releases, i.e., not sure if this is intended behavior or just the way it happens to be...
Here is my test case:
Player p = (Player)serverSession.readObject(Player.class);
System.out.println("READ IN PLAYER: " + p);
System.out.println("EXISTS IN IDMAP: " + serverSession.containsObjectInIdentityMap(p));
UnitOfWork uow = cs.acquireUnitOfWork();
Player pc = (Player) uow.registerObject(p);
pc.setName(pc.getName()+"i");
System.out.println("REMOVING FROM IDENTITY MAP..." + p);
serverSession.removeFromIdentityMap(p);
System.out.println("REMOVED!!!");
System.out.println("EXISTS IN IDMAP: " + serverSession.containsObjectInIdentityMap(p));
System.out.println("COMMITTING");
uow.commit();
System.out.println("JERSEY OF P IS: " + p);
System.out.println("EXISTS IN IDMAP: " + serverSession.containsObjectInIdentityMap(p));
System.out.println("== " + (p == serverSession.readObject(p) ));
Here is the output:
ServerSession(69)--client acquired
ServerSession(69)--Connection(72)--SELECT NAME, HOMETOWN, POSITION, ID, TEAM_ID FROM PLAYER
READ IN PLAYER: Player: No.null Giroux, Raymond From North Bay, Ont D
EXISTS IN IDMAP: true
ClientSession(76)--acquire unit of work:75
REMOVING FROM IDENTITY MAP...Player: No.null Giroux, Raymond From North Bay, Ont D
REMOVED!!!
EXISTS IN IDMAP: false
COMMITTING
UnitOfWork(75)--begin unit of work commit
ClientSession(76)--Connection(73)--begin transaction
UnitOfWork(75)--Connection(73)--UPDATE PLAYER SET NAME = 'Giroux, Raymondi' WHERE (ID = 10)
ClientSession(76)--Connection(73)--commit transaction
UnitOfWork(75)--end unit of work commit
UnitOfWork(75)--release unit of work
JERSEY OF P IS: Player: No.null Giroux, Raymondi From North Bay, Ont D
EXISTS IN IDMAP: true
== true

Similar Messages

  • What are the consequences of changing the scratch disc??

    What are the consequences of changing the scratch disk? Everything was fine with my project until I tried to work on a new project for someone else. I uploaded new footage to a new session and changed the scratch disk to my other external hard drive. Now there is confusion with my initial project..

    This is something we all live with. You have to be careful going back and forth between projects, if you are using different scratch disks for each. If you are editing a project on one scratch disk, then start a new project on another, remember to switch back to the original scratch disk when you go back to the original project. Otherwise render files will wind up on the wrong drive, or worse, you will capture to the wrong drive. Each issue is correctable by managing your media over to the proper drive, and deleting then deleting from the other.

  • Deletion of setup data : what are the consequences ?

    Hello,
    I am a sap basis guy, and currently perfroming an Upgrade (4.7-->ECC6).
    during the preparation phase, I had some problems with BW estraction data that correspond to the symptoms described
    in sap note 1083709; I executed the report RMCEXCHK and deleted the content of the setup data "02" and "11".
    This is still harmless , as we are in the QAS system, but I'm concerned about the upcoming upgrade of the production environneemnt.
    What are the consequences of deleting the setup tables ?
    I'm really confused about what need to be done after the upgrade, regarinf the BW setup tables that have been emptied :
    Do you know if :
    The setup tables "02" and "11" should be reconstructed ? This should be done when no users are connected?
    BW delta loads "02" and "11" will still be operationals ? Or do we need to plan new BW initializations ?
    are there any others side effects of deleting the setup tables ?
    Thank you in advance for your help.
    Regards.

    Hello,
    Before upgradations all the users will be locked and there wont be any transactions in the surce system....
    concerning to delta queues there....All the data have to be extracted before upgradation from delta queues into BW   this is important.
    Concerning to setup tables....there wont be any problems if you delete, because there wont be any oads going on at this time....
    Its always preferable to have some sort of communication with BW guys at upgradation time, make one check list what need to be done before upgradtion and after upgradtion...speak with BI people they will explain their steps...and as a basis guy you can prepare your check lists.
    Filling of setup tabless....no need to be done from your side that BI people will do if it is required.
    no initializations required after upgradtions.
    Regards,
    pavan.

  • What are the consequences of De-Authorizing all computers.

    I've had an iTunes account for years and its only fairly recently that i've been a bit more aware of the authorizing of computers.
    I've hit my limit of 5 but 3 of these are computers that i no longer own and don't have access to. I have made purchases, have an iPod Touch with Apps. What are the consequences of De-Authorizing all computers.
    Will it cause me problems with my purchased content and registration of my iPod Touch (don't want to lose any content) or is it just a case of providing my apple id when first listening to purchased content.
    Message was edited by: prstewart

    You won't physically lose anything. You will just need to reauthorize the computer(s) that you actually have.
    Best of luck.

  • What are the consequences of Compiling a trigger in peaktime in a Database.

    What are the consequences of Compiling a trigger in peaktime in a Database.

    Compiling a (table) trigger, would temporarily require a lock on the involved table.
    So, no open transactions that involve the table can exist.
    Since a trigger is a top-level object (dba_dependencies - wise), compiling it will not invalidate other objects.
    Having said this: I would not advise doing this during peaktime...

  • What are the consequences of using mismatched wattage power cords on macbooks?

    I am fortunate enough to have a macbook air, a macbook pro, and a macbook at my house. Sometimes the power cords get mixed up. What are the consequences of using the lower wattage macbook air power cord with the macbook pro and vise versa?
    Paul

    It will work but it isn't recommended. The PSU of the MBA will be charged for the maximum amount of power it can deliver so it might break sooner than normal, but I doubt you'll ever notice it if you're not doing this on a daily basis. It might also be possible that your MBP will not charge (as fast) from the MBA PSU.
    The other way around is no problem since the device will only ask as much power from the PSU as is needed.

  • I have a problem that my phone only vibrates but does NOT ring any more.  No matter what I try to do with settings turning off "silent" or whatever nothing helps.  Do I need to reset.  what are the consequences of resetting?

    I have a problem that my phone only vibrates but does NOT ring any more.  No matter what I try to do with settings turning off "silent" or whatever nothing helps.  Do I need to reset.  what are the consequences of resetting?

    What a numpty!  Yes of course you're right.
    Couldn't find the answer when searching the forum but then came accross this.
    Next dumb question coming up! :-(

  • HT4236 i am syncing my 6228 photos, can I stop the procedure in mid operation. what are the consequences

    I am presently syncing my ipad for the first time.
    i am at step 8 of 8
    syncing 6228 photos.
    it is taking a long time.
    can I stop the procedure at this stage with no consequence.
    if any what are the consequences.

    Do matters improve if you update to iPhoto 9.4.1?
    iPhoto 9.4.1
    From the release notes for the new version:
    What's New in Version 9.4.1
    Improves the reliability of syncing to iOS devices via iTunes 
    Fixes an issue that could cause iPhoto to quit unexpectedly when using the Export command 
    Addresses an issue that could cause iPhoto to quit unexpectedly when upgrading multiple books, cards, and calendars 
    Resolves an issue with downloading and viewing photos synced from Facebook albums

  • I overcharged my ipad 2 battery for about 3 hours. what are the consequences, i overcharged my ipad 2 battery for about 3 hours. what are the consequences

    i overcharged my ipad 2 battery for about 3 hours. what are the consequences? and there are these tiny fibers and dust that enters insideipad screen. how will i clean them. .please help

    Relax, you cannot "over" charge it.  The built in charging protection ensures it will not overcharge the battery or do any damage leaving it plugged in.  Many folks (myself included) leave our iPads and iPhones plugged in overnight, all night, so they are charged and read for use the next day.

  • Can I interrupt a migration from Mac Book Pro to Imac and what are the consequences

    can I interrupt a migration from Mac Book Pro to iMac and what are the consequences

    Les:
    Here are some options:
    • You could copy the data file to your laptop, work on it, and update the file on the iMac when you are back.
    • You can use an application like Log Me In to access your home computer from your laptop.
    • You can use DropBox. Install it on both computers, place your data file in a folder on the iMac, access it and work on it on your laptop and it will be automatically updated on your computer at home, even if it is not turned on, as soon as it is connected to the internet.
    Please do post back with further questions or comments.
    cornelius

  • What are the consequences of an IOException?

    Hi,
    my program connects as client over TCP/IP to a server and reads/writes data. Whether read and write of Input-/OutputStreams of the socket or readLine of a wrapping BufferedReaders, all can throw exceptions, particularly IOExceptions.
    My question now is, what does that mean and how to handle them?
    On write the API documentation says "[...] if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.", on read "If the first byte cannot be read for any reason other than end of file, or if the input stream has been closed, or if some other I/O error occurs." or simply "If an I/O error occurs".
    Now to appropriately handle those situations I should know what it means and what the consequences are. An exception on a connect surely means no connection is established. On read and write nothing has been read or written. But does the connection itself still exist or not?
    Secondly I often read to try/catch as late as possible, not around every call that is declared with throws. But then you're losing detail information of which call actually threw the exception and you only know that "something IO related went wrong".
    I think the most secure would be to view the connection as broken, disconnect (closing all streams and sockets of the connection) as a precaution and start over from the beginneing. But on the other hand this might be overkill.
    So what do your IOException handlers look like and where are they?
    nelian

    sjasja wrote:
    An exception on a socket I/O operation means the connection and the socket are hosed, no further communication is possible, and the only sensible thing is to close the socket. I rarely find it necessary to tell socket exceptions apart, other than logging them; they all mean it's dead, Jim.Thank you, that's a pretty complete and usefull answer. So I wouldn't overreact calling my disconnect method (which tells the rest of the app that it's offline).
    UnknownHost and Co. can be caught separately for error reporting but you're right in forwarding e.message should be best. Only problem might be localised applications where users want to have localised error reports (getLocalizedMessage mostly likely isn't overwritten).
    The (AFAIK only) exception to this is SocketTimeoutException after which the socket is still fine. You'll only get those if you ask for them (socket.setSoTimeout()). Then you'll need to arrange your code suitably so you can deal with them.Yes, that I figured myself. But after experimenting I found this feature of no use for me anyway.
    Thanks,
    nelian
    Edited by: nelian on May 8, 2009 2:43 AM

  • After installing security update 10.6.8 I've seen dialog boxes asking me if I will permit certain root processes, e.g. configd, to receive unsolicited messages from the internet. What are the consequences of denying these requests?

    After installing security update 10.6.8 last night I've seen dialog boxes asking me if I will allow incoming network connections to certain root processes, e.g. configd.  I didn't see these dialog boxes prior to installing 10.6.8.  How do I make  informed decisions? In other words,
    (1) Where can I find 25-word summary descriptions of these processes?
    (2) Where can I find discussions of the consequences of granting or denying these requests?
    Alternatively (and at some risk of revealing metaphysical doubt) why am I being asked for these permissions?  And who expects me to make correct decisions?
    I have turned on th standard-issue OS X firewall and am running my system in stealth mode.

    After installing security update 10.6.8 last night I've seen dialog boxes asking me if I will allow incoming network connections to certain root processes, e.g. configd.  I didn't see these dialog boxes prior to installing 10.6.8.  How do I make  informed decisions? In other words,
    (1) Where can I find 25-word summary descriptions of these processes?
    (2) Where can I find discussions of the consequences of granting or denying these requests?
    Alternatively (and at some risk of revealing metaphysical doubt) why am I being asked for these permissions?  And who expects me to make correct decisions?
    I have turned on th standard-issue OS X firewall and am running my system in stealth mode.

  • What are the consequences of not backing up controlfile in hot backup.

    Hi All,
    We have 8i,9i, 10g and 11g database. The unfortunate thing is that we are using this user managed hot backups for backing up our database. and I have no idea for what reason, we are not backing up the controlfile. Anyway, I would like you to comment on this, they said, they will recreate a text based controlfile and do the recover database until cancel using backup controlfile ; I know, if we have the path of all the datafiles , we can use this, but is this a right strategy ? of course, no one would agreed on this. I really appriciate, if somone could express his opinion in detail.
    Regards

    Hi,
    The database consists of the following files:
    Spfile/Pfile
    Controlfile
    Datafile
    Redo Log
    archivelog
    When we talk about backing up the database, (no matter how) must take backup up of all these files.
    If you are not taking these files in your backup you have a incomplete backup.
    Why not take a back up of control file to a binary file. Is more simple and fast restore controlfile using binary file.
    ALTER DATABASE BACKUP CONTROLFILE TO '/oracle/backup/control.bkp';To Trace should be used to produce SQL statements that can later be used to re-create your control file.
    ALTER DATABASE BACKUP CONTROLFILE TO TRACE;Why not use RMAN? A resource with endless options and features.
    Using user-managed backup you have none options/feature compared with the use of RMAN.
    It can be used in all Oracle databases without additional license.
    Regards,
    Levi Pereira

  • My Apple ID is my Yahoo email address My Yahoo email is now corrupted by the latest virus. Do I need to change my Apple ID to say, gmail, instead of Yahoo?  If I do change Apple ID, what are the consequences - do I lose apps etc? Thanks

    Wondering if it is necessary to change Apple ID if my yahoo emails are infected by virus? If I do change it what happens to all apps  etc previously purchase ors acquired using the old Apple ID?

    An e-mail account cannot be "infected." I'm guessing that you are seeing that it is sending out e-mail containing malware of some kind... if that's the case, that just means that either someone is faking your address in e-mail being sent from somewhere else, or your e-mail address has been hacked and is being used to send malware spam. Either way, it would be prudent to change the password on your Yahoo address, as well as any other online accounts that might be associated with, or that use the same password as, that Yahoo address.
    As to the question regarding Apple IDs... all your app purchases are linked to your Apple ID, so if you abandon your current Apple ID, you lose all those apps. You would have to re-purchase them on the new Apple ID. So this isn't really a good solution, and isn't necessary in this case.

  • What are the consequences of having more than one iphone connected to the same itunes on 1 computer?

    I'm wondering if there are any weird problems or glitches to be expected when 2 iphones are connected to the same itunes on a single computer.  My wife and I both have iphone 5's with separate apple IDs.  We only have one computer with one user account so both iphones are signed in to the same itunes.  This seems to be a totally normal thing to do.  Both phones appear when I open itunes and itunes lets me choose which phone I want to look at the information for, sync, etc.  However I have noticed some unusual behavior.  For example, sometimes when I am checking apps or installing new apps on my iphone, even when I am away from home and our computer, her apple ID will show up.  I have never entered her ID into my phone.  Are there any other quirks I should know about and is there anything else to watch out for when we both have our phones connected to one computer in this way?

    You need to create a user account for your wife (or yourself depending on who has the current user account). When syncing, each of you should sign in as a separate user, login to iTunes and then sync. I had this problem when my sister got an iPhone. When we did her initial sync, everything on my iPhone showed up on hers. Apple gave me this solution.

Maybe you are looking for

  • Problem in finding and downloading Map Loader

    Hello, i am using N97 mini, i updated the map to OVI free navigation map, but i want to use the navigation without internet conncetion and for that i need to download the map and save it into my device. But the problem is i cant find the correct link

  • Cannot add workset to role

    Hello, I try to create a very simple implementation as described there : Configuring EP for connecting to SAP R/3 However, when I come to the step 'attach workset to role', I do right click the workset and choose add workset to role but nothing happe

  • Error messages when sending date-time stamp to Oracle Database

      I have a complex application that communicates with an Oracle database.  One of the table values that gets written to the table is a date-time stamp.  Until recently, the user only required a date, and this was never an error. (The format String us

  • Doubt using Proxy

    Hi, I had a small doubt, I want to implement a scenario where in if i post a xml file in the specific directory i need to get that xml data in a user defined table in R/3 sytem. To do this can i use a proxy. By defining in SPROXY Transaction. Thanks

  • AICS2 MACOSX quits when saving

    Hi all, Any thoughts on why my AICS2 program will not save a file? I know this might be a common question but I couldn't find the answer. Wade Zimmerman solved my most recent problem, now this :{