Privately Owned and Cascade Delete in DB

HI,
What is the relationship between setting privately owned in Toplink vs creating a cascade delete in Oracle DB? If I've the cascade delete in DB then what is the advantage of setting the privately owned flag in toplink?
Thanks

If you only set the cascade delete option in the database, then TopLink will have no knowledge that the private object was deleted (or that it is private in general). This would mean that TopLink would not remove the private object from the cache or process it as have being deleted. In general this may not cause your app any direct issues if you never read the private object directly as it will eventually garbage collect from the cache.
Making the relationship privately own in TopLink will also ensure the following:
- If you replace the private object with another, or set it to null, TopLink will delete the old object on the update of the source. Cascade delete only works on deletion.
- If the relationship is a 1-m and you remove an object from the collection it will be removed.
- If you refresh the parent object, by default the child will also be refreshed.
- If you merge the parent object, by default the child will also be merged.

Similar Messages

  • Virtual private database and cascade delete

    We can't secure rows deleted by cascade delete by vpd.
    User "A" have right to delete row "1" but don't have right to delete row "2".
    If user "A" delete row "1", database will delete also row "2" by cascade delete.
    Why it is possible to delete row "2"?

    Either of the two options (a policy that queries the base table or propagating the security columns to the child tables) should work.
    My preference from a data model standpoint would be to have a policy that queries the base table so that the security information can be maintained in exactly one place. But if your application is frequently querying the child tables without reference to the parent table, joining to the parent table, particularly if data volumes are such that an IN would be less than ideal, there may be performance issues to this approach.
    Copying the columns creates a potential data integrity problem-- if you change the security on a base table row, you may forget to change the security on all the child records. But that issue may not be significant if the security is essentially static once the rows are created. And it's definitely easier to tune.
    You may also want to create views that join the parent and child tables and grant users access to these views rather than to the child tables directly, which would allow you to have a single policy on the base table and get most of the benefits of the first option with less performance problems if data volumes make an IN less than ideal.
    Justin

  • Problem with cascade delete and remove bean

    I am working with two entity beans that map to two tables that have a foreign key relationship. Table B has a foreign key to A and in the database that foreign key is set for cascaded updates and cascaded deletes.
    The problem occurs when the the sytem first tries to remove bean 1 (mapped to table A) and then remove bean 2 (mapped to B) where bean 2 is associated with bean 1 with a foreign key relationship. The first remove works but then when it tries to remove bean 2 it throws a very ugly "CORBA TRANSACTION_ROLLEDBACK 9998" Maybe exception. My guess is that the reason is because bean 2's reocrd in the database was deleted when bean 1 was removed but the 'bean object' was not removed from the container.
    When I go into our Application Server and look at how it see's the tables, it show the wrong relationship. It shows a restrict delete and a restrict update realationship.
    My question is, am I wrong to think that this is a application server problem or a configuration problem? It seems to me that attempting to remove a non-existant record should not cause an error. It won't cause any SQL exceptions. Is this a flawed viewpoint? As a work around I made sure that the dependent records are deleted first but it kind of defeats the point of cascaded deletes.
    We have a limited number of support calls, should I use one or am I at fault here?

    If the database removes the record from the second
    table, why is the system trying to remove it once
    again? You should try to remove an entity from a
    single place, should it be the database or the
    application. Don't try to remove it twice.
    Regards,
    DimitarI could do this but it is a huge pain in my ass. The problem is that you might want to remove the dependent bean without removing it's parent. The object structure is a little questionable, I'll admit that. It is, as they say, the eleventh hour and I can't really change that now.
    The way this work is that the server gets a list of objects marked either as new, modified, or deleted. It then relates those changes back to the database.
    In this case we have two lists(which makes me realize where the class structure sucks.) In order to do what you suggest I would have to get all the deleted parent objects and then search all the deleted child objects for ones that have the parent's key in them.
    It would be prefferable to fix the class structure but again this is not an option.
    Anyone want to answer the question I asked?

  • Cascade delete in CMP 1:M relationship

    All,
    I have 2 CMP entity beans with 1:M relationship and cascade delete option setup. All functions of Add/Mod are working fine.
    Even cascade delete is getting trigged but not executing properly every time. Out of more than 100 records in the child table, only 99 are getting cascade deleted. I am deploying the beans using embedded OC4J which comes with JDeveloper.
    Is anyone aware of any such limitations or faced similar problem before ? Database tables don't have any integrity constraint setup.
    Thanks,
    Dhiraj

    The problem is that by making the AddrXRef privately owned it cannot be reparented. Once it is removed from it's parent's list (either one) it will be deleted. To achieve what you're trying to do you'll need to delete the old incorrect AddrXRef and replace it with a new correct one.
    From the TopLink Developer's Guide[1]:
    When you tell TopLink that a relationship is privately owned, you are specifying that:
    * If the source of a privately owned relationship is deleted, then delete the target.
    * If you remove the reference to a target from a source, then delete the target.
    --Shaun
    [1] http://www.oracle.com/technology/products/ias/toplink/doc/10131/main/_html/uowbas007.htm#i1134011

  • Entity remove triggering select stmts on private owned relationships

    Hi All,
    When ever we do an entityManager.remove on an entity and commit, the eclipse link is doing a realAllQuery.execute (Select stmt) on each of the privateOwned entities of the given entity(irrespective of whether they are present or not) before actually deleting them .
    This is very much redundant especially if there are large number of entities to delete/cascade delete and each has multiple number of private owned rels - Lots of SELECT SQls , and time taken for these select sqls is very much higher than actual delete stmts. Is there a way to remove the private owned rels without selecting them.
    We are using the ecliselink 2.3.1 version.
    BTW
    This readAllQuery.execute on private owned entitites is triggered during CollectionMapping.recordPrivateOwnedRemovals method of eclipse link during commit.
    Any Input or suggestion greatly appreciated.
    Thanks,
    Sriram

    EclipseLink needs to load an object's private owned relationship to delete the objects, otherwise it does not know which objects to delete.
    The private owned objects can have their own private owned objects and dependent relationships that need to be deleted as well.
    EclipseLink does perform a delete-all optimization for a privately owned OneToMany where the target does not have any dependent relationships (or inheritance/multiple tables/ locking).
    This will occur for a simple OneToMany but most have relationships of their own that prevents the optimization.
    This optimization can also be configured using the @DeleteAll annotation.
    EclipseLink also supports delete cascading on the database, if you have created your foreign key constraint to cascade on delete, or are using EclipseLink to create your schema.
    If you use @CascadeOnDelete, then the related objects should not be loaded.
    If you still think you have more SQL than you think is correct, please include your object model code, and the SQL log for the delete.

  • Remove privately owned object: SQLException: cannot update ... to NULL

    I have a toplink descriptor called ToplinkRelationshipInfo which has a one-to-many mapping to a descriptor called ToplinkRelationshipAttribute. The mapping is privately owned and uses a foreign key from ToplinkRelationshipAttribute.info_id -> ToplinkRelationshipInfo.id. The ToplinkRelationshipAttribute has a one-to-one mapping back to the ToplinkRelationshipInfo.
    The toplink generated Java source for ToplinkRelationshipInfo has a removeFromAttributes method:
    public void removeFromAttributes(ToplinkRelationshipAttribute aToplinkRelationshipAttribute) {
         this.attributes.remove(aToplinkRelationshipAttribute);
         aToplinkRelationshipAttribute.setRelationshipInfo(null);
    }When deleting/removing one of these attributes, if I simply call the above method and then call commit on the unit of work I get a SQLException:
    Internal Exception: java.sql.SQLException: ORA-01407: cannot update ("WC"."WP_RELATIONSHIP_INFO_ATT"."RELATIONSHIP_INFO_ID") to NULL
    I understand that the reason for this is because the removeFromAttributes method is setting the attribute relationshipInfo member to null, which is causing an UPDATE on the attribute record with null on the required relationshipInfoId.
    As suggested in another thread I removed the line that sets the relationshipInfo member to null and I no longer get the exception.
    For maintenance reasons I'd prefer to modify as little generated toplink code as necessary, so I'd rather not have to modify the remove method; otherwise I'll have to go through and modify all these types of methods anytime I generate new Java source.
    So, how come toplink is generating the code that nulls these member variables if they have to be taken out later?
    Is there a way to configure the workbench project so that it does not generate this code, or is it necessary to modify these methods each time I generate the Java source?
    Thanks.

    In a 1-m mapping the relationship is stored in the database by the foreign key of the 1-1 (m-1) back reference. In a typical 1-m relationship if you just remove the object from the collection it will not update the database unless you also set the 1-1 back to null, (as it will still be referencing the old source and the relationship will be out of synch).
    In your case because the 1-m is privately owned and the target will be deleted, it does not need to have the 1-1 updated, so you are correct in removing the code.
    In have logged an enhancement request internally with the MW to have this code improved for private-owned 1-m relationships.
    In general the source code generation of the TopLink Mapping Workbench (or JDeveloper) is meant as a one-time generation for rapid prototyping, it is not required, and not two-way. Typically the object model will be used to provide application specific behavior, so will be maintained by hand after the initial prototype.

  • Moving Private Owned Objects?

    If I have a object that is privately owned, and I want to move it to another object, is there a way to do this without TopLink wanting to DELETE the object?
    By default, I realize that if a private object is unlinked from its owner, it will be deleted, but if it is reassigned in the same transaction, is there a way for this to simply UPDATE and to not execute the DELETE?
    Nate

    I do not believe this is possible. if you have scenarios where objects need to move between collections then do not mark them as privately-owned. You'll need to enhance you application to delete them in the cases where you need to.
    Doug

  • Deploying iworks suite when ipad will become privately owned in future

    I have a mix of privately owned and school owned ipads that are supervised by my MDM.
    The school owned ipads will become privately owned ipads in several years.
    As part of the supervision users can't install their own apps, can not remove apps.
    They can sign into iTunes.
    Apps are deployed from the MDM.
    Is there a way I can deploy iworks using tokens to the school owned ipads which will still allow the ipads to have iworks installed by the owners of the ipads when they are no longer school owned. To clarify, I want users in several years time when the MDM no longer has control of the ipads to be able to install iworks, but until then I want to control the installation.
    With the privately owned ipads can I send deploy iworks but allow the users to activate the account using there own iTunes accounts?
    Is this also the way forward for the school owned ipads.

    @To the OP:
    I own a X-Fi Elite Pro for the past 8 years now.
    Since there, this card has faithfullly seen me through 3 major PC upgrades.
    I'm currently at a point where, very sadly, much of what you've described is also weighing on my decision to not go for a Z line.
    @Creative:
    I do hope you're listening and can come up with a solution to a simply design feature - namely a fully working Stereo Surround, like the one that was available in the X-Fi line of cards via CMSS-3D.
    Regards,

  • Private-owned deletes and batch writing test case

    Has someone dealt with the following scenario ?
    I have an order containing order items a a private owned one-to-many relation ship.
    When i delete many order lines toplink generates the delete commands for order items and orders. When using batch writing the delete commands are generated in a way that the batch writing is useless (each delete command is generated on its own batch command as the following:
    [TopLink Finer]: 2008.03.03 05:57:10.343--ClientSession(22130853)--Connection(27081530)--Thread(Thread[main,5,main])--Begin batch statements
    [TopLink Fine]: 2008.03.03 05:57:10.343--ClientSession(22130853)--Connection(27081530)--Thread(Thread[main,5,main])--DELETE FROM TL_ORDER_ITEM WHERE (ORDER_ID = ?)
    [TopLink Fine]: 2008.03.03 05:57:10.343--ClientSession(22130853)--Connection(27081530)--Thread(Thread[main,5,main])--     bind => [1]
    [TopLink Finer]: 2008.03.03 05:57:10.343--ClientSession(22130853)--Connection(27081530)--Thread(Thread[main,5,main])--End Batch Statements
    [TopLink Finest]: 2008.03.03 05:57:10.359--UnitOfWork(8066625)--Thread(Thread[main,5,main])--Execute query DeleteObjectQuery( Customer Order #26 Date Ordered: java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Paris",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=184,lastRule=java.util.SimpleTimeZone[id=Europe/Paris,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2004,MONTH=9,WEEK_OF_YEAR=43,WEEK_OF_MONTH=4,DAY_OF_MONTH=22,DAY_OF_YEAR=296,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=4,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=3600000,DST_OFFSET=3600000] Order Total: 2550.0)
    [TopLink Finest]: 2008.03.03 05:57:10.359--UnitOfWork(8066625)--Thread(Thread[main,5,main])--Register the existing object Order Item: #5 Quantity: 1
    [TopLink Finer]: 2008.03.03 05:57:10.359--ClientSession(22130853)--Connection(27081530)--Thread(Thread[main,5,main])--Begin batch statements
    [TopLink Fine]: 2008.03.03 05:57:10.359--ClientSession(22130853)--Connection(27081530)--Thread(Thread[main,5,main])--DELETE FROM TL_CUSTOMER_ORDER WHERE (ORDER_ID = ?)
    [TopLink Fine]: 2008.03.03 05:57:10.359--ClientSession(22130853)--Connection(27081530)--Thread(Thread[main,5,main])--     bind => [1]
    [TopLink Finer]: 2008.03.03 05:57:10.359--ClientSession(22130853)--Connection(27081530)--Thread(Thread[main,5,main])--End Batch Statements
    If the test case does not define a private owned relation and all the deletes are done in the toplink application (first order items and the orders then the bach writing contains all the deletes.
    Any hint to have batch writing and private-owned deletes behaving on the same batch chunk on Toplink 10.1.3.3 ?

    Ok ill try to make a incompete code with the example of the problem in comments.
    class studenttest;
    //this is the messed up part all the way at the bottom of the class
                case 6:
                    ts.write(NodeList);
                    break;\\\\\\\\\\\\\\
    public class TStream{
    private StudentNodeList NodeList = new StudentNodeList();
    //calls this method
    //had it as public void write (StudentNodeList NodeList)
        public void write(Student NodeList)
            try
                output = new PrintWriter("database.txt");
                for(int i = 0; i < 5; i++)
    // had it as output.print(NodeList.equals(LastName) + "\t");
                    output.print(NodeList.getFirstname() + "\t");
                    output.print(NodeList.getLastname() + "\t");
                    output.print(NodeList.getID() + "\t");
                    output.print(NodeList.getyear() + "\t"); 
                    output.print(NodeList.getgpa() + "\t");   
                    output.println();
              }

  • Private owned delete not working

    Hi
    I am stumped by a problem trying to delete a child object from a parent's collection.
    I have set Private Owned on for the 1-many mapping, but when I remove the privately owned child from the parent and commit, no DELETE SQL is produced. The only difference from classes that I can delete by removing from the parent is that my child class does not specify direct-mapped primary keys, but rather references to the parent objects:
    public class ServiceAsset extends ServiceAssetValue implements Ownable {
         private Service service;
         private AssetType assetType;
    Here are the steps I use to remove the child:
    public void delete(AssetType assetTypeProto, Service serviceProto) throws PersistenceException {
         Service service = (Service)TopLinkSession.getServerSessionInstance().acquireClientSession().readObject(serviceProto);
         AssetType assetType = (AssetType)TopLinkSession.getServerSessionInstance().acquireClientSession().readObject(assetTypeProto);
         this.getWriteSession().logMessages();
         ServiceAsset serviceAsset = new ServiceAsset();
         serviceAsset.setService(service);
         serviceAsset.setAssetType(assetType);
         serviceAsset = (ServiceAsset)TopLinkSession.getServerSessionInstance().acquireClientSession().readObject(serviceAsset);
         ServiceAsset workingCopyServiceAsset = (ServiceAsset)getUnitOfWork().registerExistingObject(serviceAsset);
         Service workingCopyService = (Service)getUnitOfWork().registerExistingObject(service);
         workingCopyService.getServiceAssets().remove(workingCopyServiceAsset);
         this.getUnitOfWork().printRegisteredObjects();
         commit();
    Here is the mapping specification in the parent descriptor:
    <database-mapping>
    <attribute-name>serviceAssets</attribute-name>
    <read-only>false</read-only>
    <reference-class>com.xxxx.ServiceAsset</reference-class>
    <is-private-owned>true</is-private-owned>
    <uses-batch-reading>false</uses-batch-reading>
    <indirection-policy>
    <mapping-indirection-policy>
    <type>oracle.toplink.internal.indirection.TransparentIndirectionPolicy</type>
    </mapping-indirection-policy>
    </indirection-policy>
    <container-policy>
    <mapping-container-policy>
    <container-class>oracle.toplink.indirection.IndirectList</container-class>
    <type>oracle.toplink.internal.queryframework.ListContainerPolicy</type>
    </mapping-container-policy>
    </container-policy>
    <source-key-fields>
    <field>SERVICES.SERVICEID</field>
    </source-key-fields>
    <target-foreign-key-fields>
    <field>SERVICEASSETS.SERVICEID</field>
    </target-foreign-key-fields>
    <type>oracle.toplink.mappings.OneToManyMapping</type>
    </database-mapping>
    Is there an obvious mistake I am making?
    James
    p.s. The debug output from Toplink is
    ServerSession(9727266)--client acquired
    ClientSession(26675936)--Execute query ReadObjectQuery(com.xxx.ServiceAsset)
    ClientSession(23126121)--acquire unit of work: 21690871
    UnitOfWork(21690871)--Register the existing object com.xxx.ServiceAsset@12d26d2
    UnitOfWork(21690871)--Register the existing object com.xxx.AssetType@43487e
    UnitOfWork(21690871)--Register the existing object com.xxx.Service@4a96a
    UnitOfWork(21690871)--Register the existing object com.xxx.ServiceProvider@974600
    UnitOfWork(21690871)--Register the existing object com.xxx.Application@c3e967
    UnitOfWork(21690871)--Register the existing object com.xxx.Domain@1b963c4
    UnitOfWork(21690871)--Register the existing object com.xxx.Service@4a96a
    UnitOfWork(21690871)--Register the existing object com.xxx.DomainUrl@1ef3ccd
    UnitOfWork(21690871)--Register the existing object com.xxx.Domain@1b963c4
    UnitOfWork(21690871)--Register the existing object com.xxx.StatusType@166aab6
    UnitOfWork(21690871)--Register the existing object com.xxx.Service@4a96a
    UnitOfWork(21690871)--Register the existing object com.xxx.ServiceAsset@12d26d2
    UnitOfWork(21690871)--Register the existing object com.xxx.ServiceAsset@f77511
    UnitOfWork(21690871)--Register the existing object com.xxx.AssetType@2eef15
    UnitOfWork(21690871)--Register the existing object com.xxx.Service@4a96a
    UnitOfWork(21690871)--Register the existing object com.xxx.ServiceAsset@a974c7
    UnitOfWork(21690871)--Register the existing object com.xxx.AssetType@3526cf
    UnitOfWork(21690871)--Register the existing object com.xxx.Service@4a96a
    UnitOfWork(21690871)--Register the existing object com.xxx.ServiceAsset@150f0a7
    UnitOfWork identity hashcode: 21690871
    Deleted Objects:
    All Registered Clones:
    Key: [111] Identity Hash Code:4521906 Object: com.xxx.Domain@44ffb2
    Key: [2] Identity Hash Code:22185277 Object: com.xxx.AssetType@152853d
    Key: [1] Identity Hash Code:24431393 Object: com.xxx.ServiceProvider@174cb21
    Key: [1 11] Identity Hash Code:22007194 Object: com.xxx.ServiceAsset@14fcd9a
    Key: [653] Identity Hash Code:25228613 Object: com.xxx.DomainUrl@180f545
    Key: [1] Identity Hash Code:21789336 Object: com.xxx.AssetType@14c7a98
    Key: [0] Identity Hash Code:1079807 Object: com.xxx.Application@1079ff
    Key: [R] Identity Hash Code:22129680 Object: com.xxx.StatusType@151ac10
    Key: [11] Identity Hash Code:954895 Object: com.xxx.Service@e920f
    Key: [2 11] Identity Hash Code:2547660 Object: com.xxx.ServiceAsset@26dfcc
    Key: [5] Identity Hash Code:25619834 Object: com.xxx.AssetType@186ed7a
    Key: [5 11] Identity Hash Code:20050612 Object: com.xxx.ServiceAsset@131f2b4
    New Objects:
    UnitOfWork(21690871)--begin unit of work commit
    ServerSession(9727266)--Connection(9256290)--TopLink, version: OracleAS TopLink
    - 10g (9.0.4.2) (Build 040311)
    ServerSession(9727266)--Connection(9256290)--connecting session: Default
    ServerSession(9727266)--Connection(9256290)--connecting(DatabaseLogin(
    platform=>Oracle9Platform
    user name=> "xxx"
    datasource URL=> "jdbc:oracle:thin:@kfir.xxx.com:1521:ORTD"
    ClientSession(30940873)--client released
    ClientSession(30227927)--client released
    ClientSession(26675936)--client released
    ServerSession(9727266)--Connection(9256290)--Connected: jdbc:oracle:thin:@kfir.xxxxx.com:1521:ORTD
    User: xxxxxx
    Database: Oracle Version: Oracle9i Release 9.2.0.1.0 - Production
    JServer Release 9.2.0.1.0 - Production
    Driver: Oracle JDBC driver Version: 9.2.0.1.0
    ClientSession(23126121)--Connection(9256290)--begin transaction
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.Application@1079ff)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.AssetType@152853d)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.AssetType@14c7a98)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.AssetType@186ed7a)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.ServiceProvider@174cb21)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.StatusType@151ac10)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.Service@e920f)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.DomainUrl@180f545)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.Domain@44ffb2)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.ServiceAsset@131f2b4)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.ServiceAsset@26dfcc)
    UnitOfWork(21690871)--Execute query WriteObjectQuery(com.xxx.ServiceAsset@14fcd9a)
    ClientSession(23126121)--Connection(9256290)--commit transaction
    ServerSession(9727266)--Connection(9256290)--disconnect
    UnitOfWork(21690871)--end unit of work commit
    UnitOfWork(21690871)--release unit of work

    James
    I have revised the code to show that the ServiceAsset is included in the cache Service object's collection, the Service working copy's collection acquired through the UOW before the remove() call, and still exists after the remove() call. I also show that at all times the ServiceAsset's service is never set to null, by accessing the Service's collection via the ServiceAsset.
    What is the remove() method actually doing, if Service specifies serviceAssets as java.util.Collection, serviceAssets get instantiated as new java.util.ArrayList, and MW specifies IndirectList for indirection?
    The wierd thing is that the cached Service object's serviceAsset collection actually grows after the remove() is called on the working copy.
    Thanks if you can offer any further ideas.
    James
    public void delete(AssetType assetTypeProto, Service serviceProto) throws PersistenceException {
         ServerSession ss = (ServerSession)SessionManager.getManager().getSession("Default");
         ClientSession cs = ss.acquireClientSession();
         UnitOfWork uow = cs.acquireUnitOfWork();
         Service service = (Service)cs.readObject(serviceProto);
         for (Iterator it =service.getServiceAssets().iterator(); it.hasNext(); ) {
              ServiceAsset sa = (ServiceAsset)it.next();
              System.out.println(sa.getService().getServiceId() + " | " + sa.getAssetType().getAssetTypeId());
         AssetType assetType = (AssetType)cs.readObject(assetTypeProto);
         uow.logMessages();
         ServiceAsset serviceAsset = new ServiceAsset();
         serviceAsset.setService(service);
         serviceAsset.setAssetType(assetType);
         serviceAsset = (ServiceAsset)cs.readObject(serviceAsset);
         System.out.println("ServiceAsset to delete: serviceId: " + serviceAsset.getService().getServiceId() + " and assetTypeId: " + serviceAsset.getAssetType().getAssetTypeId());
         System.out.println("Does ServiceAsset to delete exist in Service collection? " + serviceAsset.getService().getServiceAssets().contains(serviceAsset));
         System.out.println("Does ServiceAsset to delete exist in Service collection again? " + service.getServiceAssets().contains(serviceAsset));
         ServiceAsset workingCopyServiceAsset = (ServiceAsset)uow.registerExistingObject(serviceAsset);
         Service workingCopyService = (Service)uow.registerExistingObject(service);
         System.out.println("ServiceAsset Working Copy to delete: serviceId: " + workingCopyServiceAsset.getService().getServiceId() + " and assetTypeId: " + workingCopyServiceAsset.getAssetType().getAssetTypeId());
         System.out.println("Does ServiceAsset Working Copy to delete exist in Service Working Copy collection? " + workingCopyServiceAsset.getService().getServiceAssets().contains(workingCopyServiceAsset));
         System.out.println("Does ServiceAsset Working Copy to delete exist in Service Working Copy collection again? " + workingCopyService.getServiceAssets().contains(workingCopyServiceAsset));
         workingCopyService.getServiceAssets().remove(workingCopyServiceAsset);
         System.out.println("Does ServiceAsset Working Copy to delete exist in Service Working Copy collection? " + workingCopyServiceAsset.getService().getServiceAssets().contains(workingCopyServiceAsset));
         System.out.println("Does ServiceAsset Working Copy to delete exist in Service Working Copy collection again? " + workingCopyService.getServiceAssets().contains(workingCopyServiceAsset));
         uow.commit();
         service = (Service)cs.readObject(serviceProto);
         for (Iterator it =service.getServiceAssets().iterator(); it.hasNext(); ) {
              ServiceAsset sa = (ServiceAsset)it.next();
              System.out.println(sa.getService().getServiceId() + " | " + sa.getAssetType().getAssetTypeId());
    ServerSession(9089012)--client acquired
    ClientSession(11633812)--acquire unit of work: 22482780
    ClientSession(11633812)--Execute query ReadObjectQuery(com.xxx.ce
    ntral.Service)
    11 | 1
    11 | 2
    11 | 5
    ClientSession(11633812)--Execute query ReadObjectQuery(com.xxx.ce
    ntral.AssetType)
    ClientSession(11633812)--Execute query ReadObjectQuery(com.xxx.ce
    ntral.ServiceAsset)
    ServiceAsset to delete: serviceId: 11 and assetTypeId: 5
    Does ServiceAsset to delete exist in Service collection? true
    Does ServiceAsset to delete exist in Service collection again? true
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.ServiceAsset@773d03
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.AssetType@da5bc0
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.Service@6f19d5
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.ServiceProvider@4a0ac5
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.Application@12cd8d4
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.Domain@15da7d
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.Service@6f19d5
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.DomainUrl@34f445
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.Domain@15da7d
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.StatusType@d8c3ee
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.Service@6f19d5
    ServiceAsset Working Copy to delete: serviceId: 11 and assetTypeId: 5
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.ServiceAsset@c707c1
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.AssetType@19ccb73
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.Service@6f19d5
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.ServiceAsset@15b6aad
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.AssetType@12e7cb6
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.Service@6f19d5
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.ServiceAsset@773d03
    UnitOfWork(22482780)--Register the existing object com.xxx.centra
    l.ServiceAsset@1f1e666
    Does ServiceAsset Working Copy to delete exist in Service Working Copy collectio
    n? true
    Does ServiceAsset Working Copy to delete exist in Service Working Copy collectio
    n again? true
    Does ServiceAsset Working Copy to delete exist in Service Working Copy collectio
    n? true
    Does ServiceAsset Working Copy to delete exist in Service Working Copy collectio
    n again? true
    UnitOfWork(22482780)--begin unit of work commit
    ServerSession(9089012)--Connection(12832866)--TopLink, version: OracleAS TopLink
    - 10g (9.0.4.2) (Build 040311)
    ServerSession(9089012)--Connection(12832866)--connecting session: Default
    ServerSession(9089012)--Connection(12832866)--connecting(DatabaseLogin(
    platform=>Oracle9Platform
    user name=> "skynetdev"
    datasource URL=> "jdbc:oracle:thin:@kfir.xxx.com:1521:ORTD"
    ServerSession(9089012)--Connection(12832866)--Connected: jdbc:oracle:thin:@kfir.
    surfkitchen.com:1521:ORTD
    User: SKYNETDEV
    Database: Oracle Version: Oracle9i Release 9.2.0.1.0 - Production
    JServer Release 9.2.0.1.0 - Production
    Driver: Oracle JDBC driver Version: 9.2.0.1.0
    ClientSession(11633812)--Connection(12832866)--begin transaction
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.Application@14f5021)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.AssetType@fd9b97)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.AssetType@f12b72)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.AssetType@1bdbf9d)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.ServiceProvider@1092447)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.StatusType@1277a30)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.Service@91520)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.DomainUrl@90ed81)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.Domain@bb6255)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.ServiceAsset@b890dc)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.ServiceAsset@46a09b)
    UnitOfWork(22482780)--Execute query WriteObjectQuery(com.xxx.cent
    ral.ServiceAsset@ce3b62)
    ClientSession(11633812)--Connection(12832866)--commit transaction
    ServerSession(9089012)--Connection(12832866)--disconnect
    UnitOfWork(22482780)--end unit of work commit
    UnitOfWork(22482780)--release unit of work
    ClientSession(11633812)--Execute query ReadObjectQuery(com.xxx.ce
    ntral.Service)
    11 | 1
    11 | 2
    11 | 5
    11 | 5
    ServerSession(9089012)--client acquired
    ClientSession(4496124)--Execute query ReadObjectQuery(com.xxx.cen
    tral.Service)
    10-Jun-2004 14:59:17 org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
    ull=true
    ClientSession(11633812)--client released
    ClientSession(4496124)--client released

  • Privately owned object delete problem

    If I delete a privately owned object (B), AND delete its parent (object A, contains B), then the order of SQL deletes is incorrect:
    DELETE FROM A
    DELETE FROM B
    If I just delete object A, then Toplink orders deletes properly:
    DELETE FROM B
    DELETE FROM A
    NOW, the question is, can something be done to fix this because not deleting a privately owned object is not an option (its a long story, but there is a business logic related to this that deletes A when no more B's left, but there is no way to know that up front).
    Thanks
    - rustam -

    There is a previous thread regarding some similar issues:
    Order of delete in unit of work
    The last 2 or 3 posts make me wonder if the issue is similar to the one you are experiencing.
    Does that thread help?

  • I have deleted my private folder and do not have enough space to reinstall my operating system. How can i transfer files from my hard drive to an USB drive to free up space when the operating system isn't working. or do i need to erase disk?

    i have deleted my private folder and do not have enough space to reinstall my operating system. How can i transfer files from my hard drive to an USB drive to free up space when the operating system isn't working. or do i need to erase disk through disk utilities without erasing data (but will it delete my programs such as photoshop, office, creative suite?

    Connect the computer to another Mac and put it in FireWire Target Disk mode, or use the Disk Utility to clone the drive or image specific folders with the USB drive as the target. After you've copied off everything you want, you'll likely need to erase the drive and reinstall the applications.
    (69695)

  • Hi, I need to take my daughter off from our Apple account and set up her own. So, delete her from one account and create her own. Realize I sound imbecilic for not knowing how to do this. Any ideas? Thank you so much. Jules

    Hi, I need to take my daughter off from our Apple account and set up her own. So, delete her from one account and create her own. Realize I sound imbecilic for not knowing how to do this. Any ideas? Thank you so much. Jules

    You don't have to take her off your account exactly: she needs to sign out from your account on her computers and devices. Then she can obtain an Apple ID at http://appleid.apple.com and use it to sign into System Preferences or Settings>iCloud.
    However, there are some issue about this. If she has been syncing her calendars and contacts to your account then the data will disappear from her devices, but remain on your account. Individual calendars can be exported  as .ics files and reimported into her account, but if she has her contacts mixed up with yours she will have to enter them individually in the new account (or export yours, import them into hers, and delete the ones she doesn't want.
    More intractable is the email issue. She cannot move an address from your account to hers, so if she has been using a alias on your account to have her own address she cannot transfer it. She will have to create a new email address.

  • Our daughter figured out on her own how to delete songs and apps from her IPAD2. Her parents would like to know how to delete such files and then how to prevent our daughter from doing it.

    Our daughter figured out on her own how to delete songs and apps from her IPAD2. Drives us crazy since we continually have to reload these files. Her parents would like to know
    1. how she did it (delete files) and
    2. how to prevent her from deleting files in the future.

    http://support.apple.com/kb/ht4213

  • My iphone5 has been hacked, so every message I get in Outlook is addressed to a Fatima Quedas, who is on my list of contacts and has two email addresses, one on gmail and the other my own.  I deleted the contact.  What else should I do?

    My iphone5 has been hacked, so every message I get in Outlook is addressed to a Fatima Quedas, who is on my list of contacts and has two email addresses, one on gmail and the other my own.  I deleted the contact.  What else should I do?

    change your email passwords.

Maybe you are looking for

  • Mail wont open ".wmv" attachments

    I'm new to Mac, just recently converted on the laptop. Question is...How do I run a .wmv file? I get lots of short clips in emails, but I am prompted to choose an app...What to choose? Is there an application that I can download? Thanx in advance, Ja

  • HT5163 does the sim card store pictures automatically?

    I just did a software upgrade on my 4s, and after the 3 hours that it takes to do it finishes up, the phone says it needs to be restored!! Now, earlier it said it backed up everything but I'm not sure. As i try to restore it, the phone comes on to sh

  • Strange message keeps popping up on Safari

    Hi folks, I keep getting a message popping up saying: There is no application set to open the URL httpss://b3-uk.mookie1.com/2/Radium_One/Volvo/Activation_Q2_2014/WRAPS/0414/1$1 401900025465@X50?. I haven't the faintest idea what this is, I haven't e

  • Fonts Not Rendering Properly in Photoshop Elements 11

    For some odd reason, Elements stopped rendering my fonts properly.  For instance, if I use an old standby like Rage Italic, the lettering is not smooth rather choppy like an old System type font.  I've tried uninstalling and then reinstalling but not

  • Photoshop elements organiser

    Can't open the editor from the organiser in elements 12 I get a message saying could not load fast core routines module and MMXcore routines module also multi processer support module in this version of photoshop. Can anyone explain what they are and