Updating Transient objects in Kodo 2.5.5

I have a situation where I construct a JDO object in transient state in my
code ( for batch processing of data from a file into the database) by
calling the objects contructor and setting it's values. The row
representing this object may or may not exist in the database.
How do I make the object peristant ? If the row already exists, then I
must be able to update the row with the new values ( non-primary keys ).
If not, I should insert a new row.
There are no multi table relationships involved in this case. A JDO object
represents just one table.
We want to avoid the scheme which involves retrieve the object first and
then trying to update in a transaction.
Adarsh

Transaction t = kpm.currentTransaction();
try {
MyObject o = new MyObject(...)
t.begin();
Object id = ((PersistenceCapable)o).jdoNewObjectIdInstance();
((PersistenceCapable)o).jdoCopyKeyFieldsToObjectId(id);
try{
System.out.println(id);
Object trio = pm.getObjectById(id,true);
pm.deletePersistent(trio);
}catch(ObjectNotFoundException oe){
System.out.println("First time!");
pm.makePersistent(o);
t.commit();
}catch(...){

Similar Messages

  • How can I update an object and its nested collection- Agengy, SMP 3.0

    Hello Gurus,
    I have two objects: PurchaseOrders and PurchaseItems. 1 PurchaseOrder has more than 1 PurchaseItems. In my Java code, I create a Item array in PurchaseOrder object to store the PurchaseItems.
    What I want to do is to update the PurchaseOrder object. There are 2 things I have to do:
    Update PurchaseOrder object.
    Update an existing PurchaseItem of the PurchaseOrder and/or create a new PurchaseItem of that PurchaseOrder?
    I already created a Bapi Java class to edit a selected PO and every Item of that PO on my device.
    What should I do next with the Agentry? Any help is appreciated.. Thank you very much.

    The process is virtually identical.  The only difference will be in your BAPI logic which you have already written.  You will connect it just like you are doing for the Add scenario.  Once you get that working this should follow a very similar pattern.
    --Bill

  • Unable to update this object because the following attributes associated with this object have values that may already be associated with another object in your local directory services

    Getting this error from DirSync
    Unable to update this object because the following attributes associated with this object have values that may already be associated with another object in your local directory services: [UserPrincipalName
    [email protected];].  Correct or remove the duplicate values in your local directory.  Please refer to
    http://support.microsoft.com/kb/2647098 for more information on identifying objects with duplicate attribute values.
    Quick eyeball and couldn't see the cause in the user account so used the script here:
    http://gallery.technet.microsoft.com/office/Fix-Duplicate-User-d92215ef
    And got these outputs:
    PS C:\Windows\System32\WindowsPowerShell\v1.0> Export-OSCADUserPrincipalName -UserPrincipalName "[email protected]" -Path .\outputs.csv
    WARNING: Cannot find objects with specified duplicate user principal name
    [email protected]
    Found 0 user(s) with duplicate user principal name.
    Where to from here?
    Richard P

    Hi,
    Did you talk about the Microsoft Azure Active Directory Sync tool ?
    If yes, this issue occurs if one or more of the following conditions are true:
    An object in the on-premises Active Directory has an SMTP address that's the same as the SMTP address of the object that's reporting the problem.
    An object in the on-premises Active Directory has a mail attribute that's identical to the object that's reporting the problem.
    An object already exists in your organizational account and has the same SMTP address or mail attribute as the object in the on-premises Active Directory
    More detail information, please refer to:
    http://support.microsoft.com/kb/2520976/en-us
    [Troubleshooting] Unable to update this object because the following attributes associated with this object
    http://blogs.technet.com/b/aadsyncsupport/archive/2014/05/20/troubleshooting-unable-to-update-this-object-because-the-following-attributes-associated-with-this-object.aspx
    Regards.
    Vivian Wang

  • Re: Update Cache Objects in Delta Process Dosn't work

    Hi All,
    Re: Update Cache Objects in Delta Process doesn't work.
    BI 7 - SP 17
    This is the scenario I am working on, am running a bex query on a Cube(via a multi) with bunch aggregates.
    The daily extraction & Aggregate rollup is correct, but when I run a Bex Query it display incorrect keyfigure values as compared to what we see in LISTCUBE for the infocube.
    So when I ran the same query in RSRT with "Do not use Cache", it gave correct results and then when I ran the Bex Query again it fixed itself and it displayed correctly.
    InfoCube - standard & No compression for requests
    Query Properties are
    Read Mode - H
    Req Status  - 1
    Cache - Main Memory Cache Without swaping
    Update Cache Objects in Delta Process (Flag selected)
    SP grouping - 1
    This problem occurs once in couple of weeks and my question is there a permanant fix for it??
    OR should we turn the cache off??
    Can anyone please help.
    Thanking You.
    Rao

    Hi Kevin/Rao,
    We are currently experiencing problems with the 'Update Cache Objects in Delta' process.  Did either of you manage to resolve your issues, and if so, how?

  • How to update an object property located in an array of objects

    Hello all,
    I have a script that creates custom objects and populates them and saves them into an array. This array of objects is later converted to a CSV file for reuse later on. On a subsequent need to run the script and to save time and avoid recollecting
    data I have previously amassed, I read in the contents of the csv file and put this data into an arryOfObjects.
    I need to manipulate the data in specific objects but I can't figure out how to accomplish that task.
    I can identify the correct object within the array with the following command. I have been trying to pipe that result into either set-variable or set-itemproperty without success.
    $arrayOfObjects | select-object | where HostName -like $_.'name'
    This works, I can see my desired object and the data fields contained within it.
    I now need to modify one of the property fields. (Alias).
    I have been trying the following as a line of thought, but so far without success. It doesn't fail/error out, but it doesn't update the data either.
    $arrayOfObjects | select-object | where HostName -like $_.'name' | set-itemproperty -name Alias -value "newAlias"
    I'm wondering if I need to specify something for the -path argument, but since the array is in memory and not a registry location or a file I am not sure what I should use, if this is the problem at all.
    Any suggestions would be appreciated.
    Thanks
    Smitty

    yes, I have redacted things, and obscured other things because I can not go around posting critical infrastructure information out on the internet.
    Here is the first three lines of my .csv file
    "OrigIP","AL_HostName","AL_Found","AL_Enabled","AL_Status","N_HostName","InREDACTED","N_Found","Delta","IsStale","Ping","InDNS","InAD","Location","Alias","IsServer","HostType","OS","ApplianceName","FQDN","ChatterValue"
    "10.24.11.4","ABCD","yes","yes","never","abcd.domain.com","yes","yes","*","*","Y","Y","N","TEST","*","*","eventlog","","","ABCD.DOMAIN.COM","*"
    "10.24.12.18","EFGH","yes","yes","Dec 30 2014 09:15:00","efgh.domain.com","yes","yes","-25","No","Y","Y","Y","TEST","*","yes","eventlog","xxxxxx","","EFGH.DOMAIN.COM","*"
    When I import this file I create a new custom object (objectCurrent) which I populate with the data from the csv file. I then store this object into an array of objects (objectCollection).
    All of the data is present.
    I then read in a new csv file that would contain most of the same hosts, but possibly additional new ones. upon importing the second csv file I loop through the entries.
     I have a conditional statement that checks to see if the host name from the second csv file, if it isn't then treat it like a new object and go fill in all of the details of the object using my various functions, etc.
    Import-CSV$currentALReport-Delimiter","|ForEach-Object
         if($objectCollection.N_HostName
    -notcontains$_.'name')
            # then create a new currentObject and go populate the properties of the object 
         elseif ($objectCollection.N_HostName -contains $_.'name') {
              # copy this object and update the object's AL_Status (which is the last reported message date info)
                  # send that to the function that will parse it, compare Julian dates and see if it falls within my
                  # criteria as being stale.  if so set the IsStale property to Yes, but reguardless set the AL_Status
                  # newest last reported message data
    JRV states that "The "select object" does nothing at all unless you have a column in your CSV called "object".  The where clause will do nothing because it is syntatctically wrong and illogical. "
    I beg to differ.  Using the above command :   with the script running and the current focus ($_.'name') equals "abcd.domain.com"
     $arrayOfObjects | select-object | where N_HostName -like $_.'name'
    It obtain a single object within my array of objects similar to this:
    IP: 1.2.3.4
    N_HostName: abcd.domain.com
    IsStale: No
    LastMsgDate: Dec 30 2014 09:15:00
    Delta: 1
    Ping: Yes
    InDNS: Yes
    InAD: Yes
    Alias: *
    (other fields omitted for brevity) I could get any of my existing objects if I match the hostname
    If I used only the command "  $objectCollection | Select-Object "    it returns every object in my array.
    So to narrow down the selection to a single object I add the " | where N_HostName -like $_.'name'  "
    which gives me the exact object I am searching for.
    My only question is how can I modify the contents of the object that I have specified within the array of object???

  • Urgent - BDC program to update technical objects using transaction VA42

    Hi,
    Currently my program updates technical objects details at item level as well as BOM header level.
    But my client insists on updating at contract level i.e when u go to va42 transaction and without selecting any item, we need to go to menu,technical objects where the client  wants all the items to be displayed.
    How to do this way?, is it possible, please advise on this regard.
    Very urgent!
    Thanks in advance
    Anandh.B

    I went into va42 and tried to extras->technical objects but it saying to select the item. Without selecting any item it is not going into technical objects.
    You can only do BDC if is possible manually, since its not possible you cannot do BDC for that.
    Cheers,
    Satya

  • PARTY. CAN NOT UPDATE UNVERSIONABLE OBJECT IN A VALIDATED CONFIGURATION.

    Hi B2B gurus,
    While validating our host trading partner, I am getting below error. Could you please help me in resolving this issue. Please do the needful.
    We are using two versions of EDI
    4010(5.0) and 5020(1.0) versions
    An error occurred during validation.
    Error -: AIP-11052: Writing following objects: Trading Partner failed due to following constraint violation: PARTY. CAN NOT UPDATE UNVERSIONABLE OBJECT IN A VALIDATED CONFIGURATION.
    Regards
    Srinivas

    Hi Srinivas,
    Make sure there is no agreement in deployed state. Retire and purge all existing configurations and make sure there is no agreement in validated state.
    Regards,
    Anuj

  • Transient Object in Appliaction Service

    Hello *,
    I have three Entity services:
    one for product data from PLM -> external,
    one for price data from SD -> external,
    one for additional data -> local.
    These three services I'd like to aggregate in one application service (PriceObject) which is remote enabled and accessible as a Web Service.
    When my GUI or any other application wants to have a PriceObject, they call my PriceObjectService with material data (key) as input and get a complete PriceObject (including data from all three entity services).
    Normally, if I add entity services as dependencies to my application service it can just return one of the entity services in operations tab.
    So I think my question is:
    How can I realize a transient object as application service which aggregates entity services and returns the aggregation?
    Thanks in advance and best regards
    Joschi

    Hello Joachim,
    Unfortunately there is no way to create a custom "Aggregate" output Data Structure which would hold these 3 Entity Services.  You can create custom data structures, but there are no options for Entity types.  You should be able to create an output Data Structure that holds 3 object references, but then the client would have to look up each entity by it's service interface.
    Did you build Entity relationships for all 3 of these Entities?  If so, then you can return one from your PriceObject and then the client can navigate to the other 2 through the generated getEntity() methods.
    Maybe the best option would be to create a complex Data Structure which basically mimics the aggregate structure of your three Entities.  In your PriceObject application service method, you would have to copy over the data from the 3 Entities into the new Transient data structure.
    Regards,
    Austin.

  • Process Chain problem related to Update ODS Object Data (Further Update)

    In the process chain, the data is loaded to an ODS first then feed to an InfoCube by kind of data mart load.  But when checking the process chain, getting yellow warning msg:
    A type "Update ODS Object Data (Further Update)" process has to follow process "Activate ODS Object Data" var.our_infopackage_name in the chain
    Message no. RSMPC016
    If we add the variant "Update ODS Object Data (Further Update) after the activation of the ODS and before the InfoPackage to feed data to the cube, then another yellow warning shows up for the InfoPackage of loading data to the InfoCube that says the Update variant can not be before the loading to this Cube and etc.
    What should we do to have the problem resolved?
    Thanks

    hey Dinesh,
    How to have a wait time for the load to the cube?
    I've given you "Very helpful" rewarding points and after you give the answer to the above, I will give you the "Solve problem" rewarding points.
    Thanks

  • Doubt about Scan and Update Catalog Objects That Require Updates link

    Hi,
    I have a doubt about 'Scan and Update Catalog Objects That Require Updates' link in Administration,
    how can I know how many objects that required upgrading before I click this link???
    in doc.
    http://docs.oracle.com/cd/E28280_01/bi.1111/e10541/prescatadmin.htm#BIESG3750
    section 17.2.4 Updating Catalog Objects
    It is said 'You can confirm the need to update by viewing the metrics in Fusion Middleware Control. In the Catalog folder, find a metric called "Reads Needing Upgrade" with description "The number of objects read that required upgrading." '
    but I don't find it . my OBIEE version :11.1.1.6.2
    conld you pleae help me ??
    thank you in advance.

    That link should be there in 6 version.
    I've verified in 11g6 version doc the same is existing
    ref: http://docs.oracle.com/cd/E23943_01/bi.1111/e10541/prescatadmin.htm#BAJDDFFI
    BTW:
    http://docs.oracle.com/cd/E28280_01/bi.1111/e10541/prescatadmin.htm#BIESG3750is 11g7 version
    Thanks,
    http://cool-bi.com

  • ABAP  Object  - Persistent Services -  Transient Objects

    Hi,
    can anybody give an example of when I might want to use a transient object in the persistent services?
    Cheers
    Andrew

    Hello Andrew,
    Generally ABAP programs work with data and objects that are valid at
    runtime. They are transient i.e. temporary and disappear when program ends.
    To store this data permanently and independently of the program context,
    it must be stored in the database. Persistent Services in ABAP Objects can be used to write the current values of objects defined as persistent to associated transparent tables. Later these values can  be retrieved from the tables. In this way an object oriented database management system can be simulated.
    Regards
    Indrajit.

  • Transient object to persistent

    Hi all,
    How can I make persistent a previously created transient object? I mean, is there any other way of making it persistent instead of executing method CREATE_PERSISTENT( attributes ) ??
    Maybe something like:
    MyTransientObject = Agent->Create_Transient( ... )
    MyTransientObject->MakePersistent( )
    Thanks in advance.

    Hi Jorge,
    what I was suggesting was to just call the create_persistent method with the attributes of the transient object except the business key. Then you will get a new business key for the persistent object. Then overwrite the reference to the transient object with the new persistent object reference.
    Something like this.
    MyTransientObject = Agent->Create_Transient( ... )
    MyPersistentObject = Agent->Create_Persistent( ... ).
    MyTransientObject ?= MyPersistentObject.
    Cheers
    Graham

  • Updating Connection object HOUSE_NUM1 in the system

    Hi,
    I need to update Connection object HOUSE_NUM1 IN THE SYSTEM.
    Can you suggest me  a function modjule fkor the same.
    The standard function module ISU_S_CONNOBJ_CHANGE says coding for no dialog will be included if required.
    Regards,
    Jyothsna

    Hi Jyothsna
    I was a little bit surprised as well to see this comment instead of the necessary code for background processing.
    However, it is not overly difficult to create your own function to do so (if you don't want to change the classification).
    First have a good look through ISU_S_CONNOBJ_CREATE and create the new function with following calls:
    ISU_O_CONNOBJ_OPEN
    Here you have to populate the structures ADRC_STRUC and EHAU
    ADDR_ACCEPT_REG_DATA_ERROR  (optional)
    ISU_CONNOBJ_CHECK
    ISU_O_CONNOBJ_PREPARE_CLOSE
    ISU_O_CONNOBJ_ACTION
    ISU_O_CONNOBJ_CLOSE
    If you only want to change address information you could use functions from the central address management, of course.
    Yep
    Jürgen

  • Updating an object that is a synonym

    hi
    As the user apps, I tried to update the object ap_invoice_distributions_all but no rows were updated.
    Then I tried select object_type from dba_objects and realised it was a synonym. I did query the owner and there are two of them - apps and ap.
    So, we did the following : update ap.ap_invoice_distributions_all, and this time the table was updated.
    But which table? Is the ap.ap_invoice_distributions_all and ap_invoice_distributions_all the same table? What is the purpose of using synonyms?
    As I understand, a synonym is - as the name suggests - exactly the same as the object it represents.
    from drop tables // sqlplus scripts comments // synonyms :
    We can create Synonym only for giving alternative name for tables, view, sequence, procedure, stored function, package etc..
    Synonyms are used to hide the name and owner of an object and for providing location transparency for remote objects.
    But why bother with this synonym? If I update the synonym, I am also updating the object it is synonymous with?
    Thanks,
    DA
    Edited by: Dan A on Apr 21, 2009 2:36 AM
    Edited by: Dan A on Apr 21, 2009 2:36 AM

    Synonym is just like an alias name. It does not stores anything. It just refers to an existing object thats all.
    This is well documented read it.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#CNCPT711

  • User dont have permission to update this object

    Dear Experts,
    I have exported a from into OIM and tried to give permissions of some groups via "object permission" tab. but I am getting an error message "user dont have permission to update this object". Then I looked into (Business rule definition)Data Object Manager tab to look for permissions on my custom form but there was no system administrator group having permissions of insert, update or delete. Please suggest how to add groups to this form and provide permissions.
    Regards,
    Sidharth

    Go to your System Administrator group within OIM. On the Data Object Permissions, add the user to your form with all permissions. The entry will have the name of your form's Description. Once System Administrators is on the form, you should be able to modify however you'd like. If all else fails, you can always modify your XML file to include the System Administrators as having permission and then import again.
    -Kevin

Maybe you are looking for

  • Can't connect to wireless network with encryption.

    I have had no trouble connecting to hotel wireless networks, or my college wireless network. However, when I try to connect to my home network wirelessly, or another family member's network wirelessly, my connection times out when I enter the usernam

  • Possible bug in ccfe when using Apache STL

    Environment details: Solaris 10 @ patch version 148888-03 Sun Studio 12.3 (5.12, 2011/11/16)   I'm attempting to get boost 1.54 to build with this version of Sun Studio.  I ran into a number of issues when trying to get it to build with stlport4 (let

  • Can't install Forms and Reports under linux 8.7.1

    I try to install Forms and Reports i get this message UT60 is not available or _TK60 is not available Please help me

  • Long time for activation

    Hi , May I know the reason for 1) whenever I activate Data source object or infocubes, it is taking very long time. 2) even for deletion of DTP or deleting Data source object, its very very slow.. Generally it was not taking so much time in 3.x (not

  • FB01 Recording

    Hi Experts! We need to post documents by recording FB01 in LSMW. In this I have a few doubts. 1. How feasible it is to record FB01? I feel it is mostly not recommended. But for our requirement, we can't go for standard batch input method. 2. Suppose,