Updating a persons name using toplink uow

Hi,
I am having problems updating the name of a PERSON. I am using Toplink with a SessionBeanFacade.
I am using a Backing Bean, which is calling the Session Bean Facade. I was debugging the code and the strange thing is: I can see the updated name in the entity and in the uow, but after uow.commit the updated name isn't in the database. Why won't the values from the uow persist?
SESSION BEAN FACADE
  public Object mergeEntity(Object entity) {
    UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
    Object workingCopy = uow.readObject(entity);
    if (workingCopy == null)
      throw new RuntimeException("Could not find entity to update");
    uow.deepMergeClone(entity);
    uow.commit();
    return workingCopy;
BACKING BEAN
  public void recoverBusinesspartner(ActionEvent actionEvent) {
    DCBindingContainer dcBind = (DCBindingContainer)getBindings();
    DCIteratorBinding iterBind = (DCIteratorBinding)dcBind.get("personIterator");
    iterBind.getCurrentRow().setAttribute("name", "Bodhy");
    dcBind.getOperationBinding("mergeEntity").execute();
  }Thank you
Bodhy
Edited by: Bodhy on 30.09.2008 06:02
P.S. I don't get any errors or some other message in my log. I am using JDeveloper 11g TP3

Hello,
Glad you found the problem. As I mentioned in my previous post, you should not be modifying objects from the session cache. When you do any sort of query on a session other than a UnitOfWork, the objects returned exist in the shared session cache. When you register an object, the state of the object is pulled from the session cache and used for a comparison - TopLink will think that is the state the database is in.
This is why Detach resolves the issue- it makes a copy of the object so that changes to it do not get put into the cached copy.
I would recommend looking at:
http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/cachun001.htm
and
http://www.oracle.com/technology/products/ias/toplink/technical/unitOfWorkWP.pdf
to see how caching and the UOW work in TopLink
Best Regards,
Chris

Similar Messages

  • Update Supplier / Vendor name using InterfaceTables / Concurrent programs

    Hi there,
    Is there a way to update the suppliers or vendor Name?
    I am using interface tables with concurrent programs to import data in EBS.
    Can I update data using the same procedure? i.e by using Interface Tables and Concurrent program? what happens if one of the supplier changed it's name? What do I need to call for the update?
    Thanks for any help
    Regards,
    Stefan

    Duplicate thread? -- Re: Interface tables and cocurrent programes : updating vendor

  • Active Directory cn field not updated from sap HR using ldap.

    Hi,
    Apologies if this is in the wrong forum area.
    I am using the LDAP facility to create and modify Active Directory records from sap HR. Initially, the name field cn that was coming across into AD was in the format of the logical system and employee number, eg, RD4CLNT22000000711.
    I then implemented the BADI HRLDAP_ATTRIBUTES which then changed this name field cn in the active directory listing to the format; surname, forename.
    It works fine when I create a new user, however the problem comes when I update the persons name in the sap hr module. The data that comes across into Active Directory shows the change to the persons surname sn, forename and displayname fields is there but the cn field is still showing as the previous name.
    In short, when a new user is created, the cn field in active directory is correct
    (surname, forename) but when the employee’s name is modified, that change is not brought across to the cn field even though the surname, forename and displayname fields are updated correctlyon AD.
    We are on release 4.70.
    Anyway, if anyone could help I would be very grateful.
    Thanks
    David

    Hi
    The problem it is causing us is that the cn field is incorrect and does not mirror the change in sap HR, therefore the Active Directory entry for the employee is not totally accurate.
    When an employee changes their name in SAP HR - usually their surname, we would then want to update the employee’s active directory account to show this change and this includes the cn field also. At the moment the firstname, lastname fields do get updated with the change so we would want the cn field to show this as well otherwise the cn field would be incorrect and not match up with the employee's AD firstname & lastname fields.
    Dave

  • Update email domain name

    Hi i have OIM 9.1.0 environment.
    Any one please help me, because this very high importance task.
    I want update email domain name using task scheduler in oim User form.
    Ex: i have three users in OIM USR table with email id's:
    1. [email protected]
    2. [email protected]
    3. [email protected]
    I want update whose mail id domain is "@hotmail.com" with @gmail.com
    I want display out put like:
    1. [email protected]
    2. [email protected]
    3. [email protected]
    for that you can use API's or what ever. Finally we run the scheduler at that time domain will update with new value in User form (USR_Table).

    Hi Pandey,
                     Really thank U for your responses. I want to do this task, through schedule task using java code. So could you please help me for write java code.
    write a java code:
      - Retrieve all users in a tcresultset.
      - Iterate through each record.
      - Extract email, chain domain, form new email.
      - Extract user login and using tcuseroperationsintf change email for that login.
      - End iteration.
    Could you please send me the code ASAP. Send me the total java code, because i am not expert in java.
    Thanks

  • Updating record using toplink

    Hi,
    By registering the populated java object with the unit of work will insert a new record in the database.How about updating an existing record using UOW?
    If any sample code, it will be very helpful.
    thanks
    vasu

    http://otn.oracle.com/products/ias/toplink/technical/unitOfWorkWP.pdf
    http://otn.oracle.com/products/ias/toplink/index.html
    http://download-west.oracle.com/docs/cd/B10464_01/index.htm

  • Update Query using Toplink

    I would like to fire an update query using Toplink mapping objects. The
    structure of the Query would be like
    update <<table name>>
    set <<col name A>> = 'Y'
    where <<col name B>> in (<<valA>>,<<valB>>............);
    ValA, ValB.... are dynamic values passed from my front end Java App
    Can anyone help me in this regard...........
    Thanks
    Karthik

    Karthik,
    This is new functionality added in 10.1.3. You will want to look at UpdateAllQuery.
    Doug

  • I used to be able to increase the size font of the persons name sending me an email or text message.  I have an iphone 5 and can no longer do that.  Help!

    I used to be able to increase the size font of the persons name sending me an email or text message.  I have an iphone 5 and can no longer do that.  Help!

    Just the name? Don't ever recall that being a feature. However, for Mail and Messages (and a few other apps): Settings app > General > Text Size

  • HT204053 I am not able to update my apps because every time I am doing this, it is asking for a password which I have never used and the person who used it is in no more contact. how can i get my id instead of his??

    I am not able to update my apps because every time I am doing this, it is asking for a password which I have never used and the person who used it is in no more contact. how can i get my id instead of his??

    Apps can only be updated using the same Apple ID and password they were originally purchased with.

  • Iphone 4s - how do I change the name in the contacts for the owner of the phone - it is coming up as the other person who uses the laptop - so when ringing or texting anyone 2 names are being used as the caller id on the screen

    Iphone 4s - how do I change the name in the contacts for the owner of the phone - it is coming up as the other person who uses the laptop - so when ringing or texting anyone 2 names are being used as the caller id on the screen

    *Ralph Johns* writes:
    "Your options are:
    Get a trial account form @mac which will work as an iChat name after the 60 days run out but not be a email account that is valid (And is free)"
    Do you mean a trial account from .Mac? (DotMac)
    "Get an AIM Screen name and set it to Display what you want as you set it up.
    The Screen name can be whatever yu want but you can also set it to display something else as well."
    I had thought about this, but it seems other people have already chosen the screen name "pinksharkmark" and virtually every variation of it I can think of. So that isn't an option for me. As for getting it to display something else as well, do you mean that if I were to get an AIM screen name like "CromulentCat" I could somehow log in to iChat under the AIM account "CromulentCat" yet get iChat to represent me to my Buddies as "PinkSharkMark"? Because I have to admit I don't see how that can be done. It appears as if iChat displays to anyone chatting with you precisely the account name you logged in under and nothing else. So if you logged in using a .Mac account, then you are displayed as "[email protected]" while if you logged in under an AIM account, you are displayed as "CromulentCat". But that's it that's all... there is no way to change CromulentCat to PinkSharkMark.
    Thanks very much for taking the time to reply, though.

  • Using Toplink to generate UPDATE sql statements?

    I have a need to generate a UPDATE sql statement.
    This statement will run at startup and will not effect the cache, as no objects will be loaded prior to this command running.
    I realize that I can execute arbitrary SQL using Session, however, I have the additional requirement that this UPDATE is compatible with the DB it is running on.
    So, I want to use TopLink to generate an UPDATE statment perhaps using the query framework. Is this possible? Is there any way to use TopLink's ability to create SQL before passing this into a Session for execution?

    In the current versions your only option is to provide the UPDATE SQL directly using the executeCall(new SQLCall("UPDATE ...")).
    In 10.1.3 there exists an UpdateAllQuery intended to do such batch update calls. It will additionally invalidate any cached objects if they were to exist.
    Doug

  • Hi All, i have just purchased a second hand iphone 3GS, i want to change its registration, because this iphone is already been registered with the first person name, i cannot use app store on the phone coz it ask password which i dont have, ny suggestion

    Hi All,
    I have just purchased a second hand iphone 3GS, i want to change its registration, because this iphone is already been registered with the first person name, i cannot use app store on the phone coz it ask password which i dont have, ny suggestion how can i change the itunes password or the account settings.
    Thanks & Regards
    Ayub

    Restore the iphone as new.
    iPhone User Guide (For iOS 5.1 Software)

  • Using TopLink with SCM

    Hi!
    I was working with my .mw file with OSCM source control instead of appear this error:
    "An unexpected error has occurred.We are sorry for the inconvenience.
    Messagge:
    EXCEPTION DESCRIPTION: File already exists: [C:\Documents and Settings\mpedretti.DSI\Mis documentos\DocumentosToplink\Carpeta nueva\Table\Nueva 2.xml]
    Stack trace:
    Throwable Class Name:
    oracle.toplink.xml.XMLDataStoreException
    Message:
    EXCEPTION DESCRIPTION: File already exists: [C:\Documents and Settings\mpedretti.DSI\Mis documentos\DocumentosToplink\Carpeta nueva\Table\Nueva 2.xml]
    Stack trace:
    LOCAL EXCEPTION STACK:
    EXCEPTION [TOPLINK-13005] (TopLink - 9.0.3 (Build 423)): oracle.toplink.xml.XMLDataStoreException
    EXCEPTION DESCRIPTION: File already exists: [C:\Documents and Settings\mpedretti.DSI\Mis documentos\DocumentosToplink\Carpeta nueva\Table\Nueva 2.xml]
         at oracle.toplink.xml.XMLDataStoreException.fileAlreadyExists(Unknown Source)
         at oracle.toplink.xml.XMLFileStreamPolicy.getWriteStream(Unknown Source)
         at oracle.toplink.xml.XMLFileStreamPolicy.getNewWriteStream(Unknown Source)
         at oracle.toplink.xml.XMLFileAccessor.getNewWriteStream(Unknown Source)
         at oracle.toplink.xml.XMLAccessorStreamPolicy.getNewWriteStream(Unknown Source)
         at oracle.toplink.xml.XMLInsertCall.getWriteStream(Unknown Source)
         at oracle.toplink.xml.XMLWriteCall.execute(Unknown Source)
         at oracle.toplink.sdk.SDKAccessor.executeCall(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.executeCall(Unknown Source)
         at oracle.toplink.sdk.SDKQueryMechanism.executeCall(Unknown Source)
         at oracle.toplink.sdk.SDKQueryMechanism.executeNoSelectCalls(Unknown Source)
         at oracle.toplink.sdk.SDKQueryMechanism.insertObject(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown Source)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedWrite(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedInsert(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown Source)
         at oracle.toplink.queryframework.WriteObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWrite(Unknown Source)
         at oracle.toplink.queryframework.WriteObjectQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.internal.sessions.CommitManager.commitAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.Session.writeAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitAndResume(Unknown Source)
         at oracle.toplink.workbench.ui.BldrSession.saveProject(Unknown Source)
         at oracle.toplink.workbench.ui.BldrMainView.saveProject(Unknown Source)
         at oracle.toplink.workbench.ui.BldrMainView.saveSelectedProjects(Unknown Source)
         at oracle.toplink.workbench.ui.BldrActionManager$104.actionPerformed(Unknown Source)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    This happen when I tried to save the project. Any suggestion??
    What are the best practices to apply SCM using Toplink?
    Thanks!!
    Matias

    Whenever this happens you should be able to do a "file>save as" and save the project in a new directory -- at least you won't be loosing your work.
    Basically I think the problem is either that somehow you corrupted the project with checkin/checkout process, or you did not check out a file that the Mapping Workbench is trying to update when you save the project.
    10g Mapping Workbench, I have heard, is going to have more intelligence in the area and note ahead of time which files need to be checked out when you save your project. I think a developer preview will be available any day now, keep your eyes peeled to the OTN webpage for TopLink.
    The mapping workbench reference guide has a couple pages that talk about how to use it with SCM systems. In TopLink 903 these docs are shipped with TopLink. See page 1-11 for more info.

  • Using toplink running in oc4j in 11.1.1.0.0

    Hi,
    I'm using Toplink 11g Release 1 (11.1.1.0.0) (Build 070624) in a web app running in oc4j. I've noticed that sometimes my changes do not get flushed to the database despite the fact that I see the update and commit in toplink logging. The app does correctly see the changes when queried from multiple sessions, yet the changes are not in the db. Do you know where the changes are being cached and how I can flush them to the db?
    When I startup oc4j, all data in the table disappears. This may be due to something that someone else in our team is doing when oc4j starts up, but I haven't been able to find out what it is yet.
    I don't think these are toplink issues, but I am hoping you might be able shed some light on this.
    Thanks,
    Vicki

    Jim was spot on. As he suggested, I put in a check to see if the object I was updating was the same as the shared copy in the cache from the ServerSession and indeed it was.
    I was querying my object and using SessionFactory.detach() to make a copy. However, I was then hanging onto a copy of my object after doing a uow.deepMergeClone() and uow.commit() and this working copy seems to become the shared copy. So when I made more changes to the object, I was corrupting my session cache.
    The other unrelated problem of data being deleted when starting up oc4j was indeed some code in our app being called inadvertantly when initialized our app.

  • How Can implement the audit function using toplink?

    My system must record all the modification, how can I use toplink to implement it.
    I know when toplink modify some object, the toplink will check how many attribute
    have been modified, and then update it to database, Can I implement the record when
    the toplink check modification?
    PS: I dont want to use database trigger.
    Thank first!!

    This thread has been inactive for a while, so perhaps I'm missing something. I am attempting to create audit events on domain objects using a TopLink 10.1.3 DescriptorEventAdapter.
    These audit events mutate or create a snapshot collection on the domain object. Based on what I understand from the above thread, do I still need to create another UoW to commit these in my preInsert()/preCreate() handler methods?
    Is there a way to get in the game before the IDs are assigned to the objects and the change set is computed?
    I certainly don't claim to fully understand the historical client session docs. However, one of our requirements is to show object-attribute-level deltas (list chronologically, grouped by transaction, the attributes that have changed, who changed them, etc. with their before and after values). So my first-blush reaction is that it's easier to utilize the change set to create a collection of transactionally-grouped audit objects on the domain.
    Thanks much,
    --Todd Fredrich                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Personal name

    Outlook 2010 when using the email ([email protected]) to send my Personal name does not come up correctly. When I go into the account settings it will not allow me to change the name there.  It was working correctly when i first started using Outlook
    2010, but some where along the line it changed and I can not correct it.  If there is anyone out there that this has happened too and you were able to correct it please help. The email account is set up with MAPI now it's started off as POP but when I
    installed one of the updates everything changed.
    HELP!

    Hi,
    Do you mean your name doesn't display correctly on the recipient's side? The display name can be modified under Account Settings. See:
    https://support.office.com/en-sg/article/Change-the-display-name-that-e-mail-recipients-see-2b53331a-ba2a-4803-88dc-ac9fe376c8a9
    If it cannot be modified under Account Settings, we may try to remove the account and then recreate it with the correct display name to fix the issue. If there is any difficult when configuring your email account, you can refer to this KB article:
    http://support.microsoft.com/kb/2028939
    Regards,
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • How to change  in NOTIF_CREATE - Create Support Notification

    Hi I want to add  the following thing in the NOTIF_CREATE 1. Person Responsible-when i use to create message in notif_create my name is not appeared in the F4(I have tried in IMG-Service desk-BP ,but my name is not appeared there) 2.How to create new

  • Getting a mapping error to propogate from loop block within I.P.

    OK I kinda asked the question as a sub topic under a different heading SXMB_MONI_BPE -> Message Payload not visible in container but didnt really get an answer I'm happy with, so here goes as a main topic! The short description: I have a mapping step

  • IPhoto crash when ram is full

    Every time I open iPhoto and use it, the ram steadily gets fuller and fuller. When it is full, the program crashes. Is there a way to fix it

  • UCM search contents of HCSF / HCSP submitted content?

    I have created a HCSF form which makes an entry into the document respository. I belive the IDOC service the form uses is "SUBMIT_HTML_FORM" The new document is created and the search searches the title and the comments section but does not do the te

  • IPad Mail Won't Stay Open

    My mail on iPad wil not stay open. Can anyone help? I have had the iPad since April 28. It was working ok. Today this problem started. I want to erase messages but it will not stay open long enough for me to do this