Deleting object instances

Hi again,
If I have an instance of some custom object instantiated through the JAVA API and I want to remove this instance from the database, can I call instance.free(), or will this remove the entire object from the database ie deleting all instances? Thanks
Ian

Document doc = (Document) ifs.getPublicObject(objectId);
doc.free();
Will delete the object with the id specified in objectId
null

Similar Messages

  • Static Classes/Methods vs Objects/Instance Classes/Methods?

    Hi,
    I am reading "Official ABAP Programming Guidelines" book. And I saw the rule:
    Rule 5.3: Do Not Use Static Classes
    Preferably use objects instead of static classes. If you don't want to have a multiple instantiation, you can use singletons.
    I needed to create a global class and some methods under that. And there is no any object-oriented design idea exists. Instead of creating a function group/modules, I have decided to create a global class (even is a abstract class) and some static methods.So I directly use these static methods by using zcl_class=>method().
    But the rule above says "Don't use static classes/methods, always use instance methods if even there is no object-oriented design".
    The book listed several reasons, one for example
    1-) Static classes are implicitly loaded first time they are used, and the corresponding static constructor -of available- is executed. They remain in the memory as long as the current internal session exists. Therefore, if you use static classes, you cannot actually control the time of initialization and have no option to release the memory.
    So if I use a static class/method in a subroutine, it will be loaded into memory and it will stay in the memory till I close the program.
    But if I use instance class/method, I can CREATE OBJECT lo_object TYPE REF TO zcl_class then use method lo_object->method(), then I can FREE  lo_object to delete from the memory. Is my understanding correct?
    Any idea? What do you prefer Static Class OR Object/Instance Class?
    Thanks in advance.
    Tuncay

    @Naimesh Patel
    So you recommend to use instance class/methods even though method logic is just self-executable. Right?
    <h3>Example:</h3>
    <h4>Instance option</h4>
    CLASS zcl_class DEFINITION.
      METHODS add_1 IMPORTING i_input type i EXPORTING e_output type i.
      METHODS subtract_1 IMPORTING i_input type i EXPORTING e_output type i.
    ENDCLASS
    CLASS zcl_class IMPLEMENTATION.
      METHOD add_1.
        e_output = i_input + 1.
      ENDMETHOD.
      METHOD subtract_1.
        e_output = i_input - 1.
      ENDMETHOD.
    ENDCLASS
    CREATE OBJECT lo_object.
    lo_object->add_1(
      exporting i_input = 1
      importing e_output = lv_output ).
    lo_object->subtract_1(
      exporting i_input = 2
      importing e_output = lv_output2 ).
    <h4>Static option</h4>
    CLASS zcl_class DEFINITION.
      CLASS-METHODS add_1 IMPORTING i_input type i EXPORTING e_output type i.
      CLASS-METHODS subtract_1 IMPORTING i_input type i EXPORTING e_output type i.
    ENDCLASS
    CLASS zcl_class IMPLEMENTATION.
      METHOD add_1.
        e_output = i_input + 1.
      ENDMETHOD.
      METHOD subtract_1.
        e_output = i_input - 1.
      ENDMETHOD.
    ENDCLASS
    CREATE OBJECT lo_object.
    lo_object->add_1(
    zcl_class=>add_1(
      exporting i_input = 1
      importing e_output = lv_output ).
    lo_object->subtract_1(
    zcl_class=>subtract_1(
      exporting i_input = 2
      importing e_output = lv_output2 ).
    So which option is best? Pros and Cons?

  • Confused about deleting objects

    I'm completely new to ActionScript, and I'm having trouble
    understand how to delete objects.
    If I make a new object, for instance "var shape:Shape = new
    Shape();", and later I try to delete that object ("delete(shape)"),
    it spits an error, telling me "Attempt to delete fixed the property
    drip". This seems to go for every object.
    What's the correct to delete an object? Within the object
    itself, I tried "delete(this)", which doesn't throw an error, but
    doesn't seem to work, either.

    I still don't quite understand. If I understand correctly, I
    don't delete objects, I just leave them alone, right? Except this
    doesn't seem to be the case.
    In my main AS, I have the following code:
    public function RainTower() {
    var rainTimer:Timer = new Timer(10);
    rainTimer.addEventListener(TimerEvent.TIMER, DripDrop,
    false, 0, true);
    rainTimer.start();
    private function DripDrop(event:TimerEvent):void {
    var drip:Raindrop = new Raindrop();
    addChild(drip);
    In a separate file, I have this:
    public function Raindrop() {
    trace("New drop");
    shape.graphics.lineStyle(0, 0x0000FF, 1);
    var offset:Number = 0;
    shape.graphics.drawRect(mouseX+offset, mouseY+offset, 3, 3);
    addChild(shape);
    updateTimer.addEventListener(TimerEvent.TIMER, Update,
    false, 0, true);
    updateTimer.start();
    public function Update(event:TimerEvent):void {
    shape.x += 1;
    shape.y += 10+_speedY;
    shape.alpha -= 0.05;
    if(shape.alpha < 0) {
    updateTimer.removeEventListener(TimerEvent.TIMER, Update);
    updateTimer.stop();
    It works like you'd expect, except that no matter what you
    do, things start bogging down after half a minute. How am I
    supposed to deal with the Raindrop instances that I no longer need?
    Obviously they're still having a residual effect on things.

  • Deleting all instances of a link

    Hi,
    I have a lot of instances of a link spread over a number of pages and I want to delete all of them without having to go to each page, select each one and delete it. I thought there'd be a way using the links pallet such as right clicking the link group and "delete all" but there doens't seem to be.
    The links don't have a specific object style applied so I can't (I think) use Find/Change Object.
    Is there another way around this?
    Thanks in advance.
    (CS4 6.0.5)

    This version removes frames.
    if (app.documents.length == 0) ErrorExit("No documents are open. Please open a document and try again.", true);
    var doc = app.activeDocument;
    var links = doc.links;
    if (app.selection.length != 1) ErrorExit("Select a graphic frame with image.", true);
    var sel = app.selection[0];
    if (sel.images.length != 1) ErrorExit("Selected graphic frame should contain an image.", true);
    var selectedLink = sel.images[0].itemLink;
    var selectedLinkPath = selectedLink.filePath + "";
    if (selectedLink == null) ErrorExit("Selected item doesn't contain a link.", true);
    var allInstances = [];
    var counter = 0;
    for (var j = 0; j < links.length; j++) {
         if (links[j].filePath == selectedLink.filePath) {
              allInstances.push(links[j]);
    if (allInstances.length == 1) {
         if (!confirm("This link has only one instance. Do you want to delete it?", false, "Delete all instances of a link")) exit();
    for (var i = allInstances.length-1; i >= 0; i--) {
         try {
              var link = allInstances[i];
              var image = link.parent;
              var frame = image.parent;
              frame.remove();
              counter++;
         catch(err) {
              $.writeln(i + " - " + err);
    if (counter == 0) {
         alert("No links have been removed", "Delete all instances of a link");
    else if (counter == 1) {
         alert("One clink has been removed", "Delete all instances of a link");
    else if (counter > 1) {
         alert(counter  + " links have been removed", "Delete all instances of a link");
    function ErrorExit(myMessage, myIcon) {
         alert(myMessage, "Error", myIcon);
         exit();

  • Does remove() deletes object?

    I'm a self-studying student of java. I've been reading this forum for six months but it's my first time to post a question. This forum have been one of my teachers on java.
    Please help me with my problem:
    I created a synchornized map myMap with strings as the key and instance of MyClass as the values.
    Map myMap = Collections.synchronizedMap(new HashMap());
    I used the follwing statement to add values to myMap:
    myMap.put(someString, new MyClass());
    I used the following statement to remove an element from myMap:
    myMap.remove(someString); // note: this removing is always successful
    My problem is that I always get OutOfMemoryError and when I check my profiler, the instance of MyClass I created with myMap.put(someString, new MyClass()); is not garbage collected even I have already remove them from myMap.
    My question is "does remove() also deletes object?" If it doesn't, please give me some tip on how to delete those objects so that I will no longer get OutOfMemoryError.
    Thank you very much.

    My question is "does remove() also deletes object?" If
    it doesn't, please give me some tip on how to delete
    those objects so that I will no longer get
    OutOfMemoryError.No. It's about time for you to learn this: the Map doesn't contain any objects. It just contains references to objects. So when you call its remove() method, it removes the reference to the object from the Map. It doesn't "delete" the object itself. Nothing in Java will "delete" an object except for the garbage collector.
    And the garbage collector will only remove an object from memory if there is nothing in your program that has a reference to it. The fact that you are running out of memory means that something else, other than the Map, still has references to all those objects. From the code you have posted it's impossible to tell what that might be, but there must be something.

  • Object instance 1200 does not exist (while executing task SWUS)

    hello all,
    i have created a workflow class and two methods (constructor, display) and 1 attribute PLANT (instance,public) in it.
    i am using this class and display method in task t code PFTC.
    While executing this task from SWUS , i am getting this error.Object instance 1000 does not exist.
    As i was going through this blog. i have created everything exactly just like it is mentioned there.
    But still i am getting this error. please guide me to detect where i am mistaken.
    http://scn.sap.com/community/bpm/business-workflow/blog/2006/07/25/using-abap-oo-methods-in-workflow-tasks
    this is class screen-shot and error i am facing while executing the task.
    The methods which are implemented using the interface are emtpy(don't contain any source code lines).

    sorry i forgot to mention that input value 1000 does exist in our system.
    i have also tried F4 help. it is showing all existing plants in our system, but still it is not accepting values select from f4 help.
    Also to add information,
    I have executed class using F8 option in class builder, and it is working perfect.
    source code of display method.(i am trying to view plant in display method just like in blog).
    method DISPLAY.
    break-point.
       data: ls_vt001w type v_t001w.
       CLEAR ls_vT001W.
       ls_VT001W-MANDT = SY-MANDT.
       ls_VT001W-WERKS = me->PLANT.
       CALL FUNCTION 'VIEW_MAINTENANCE_SINGLE_ENTRY'
         EXPORTING
           ACTION    = 'SHOW'
           VIEW_NAME = 'V_T001W'
         CHANGING
           ENTRY     = ls_vT001W.
    endmethod.

  • BW variable: Inconsistent in loading. please check use of deleted objects

    Hi Experts,
    I encountered an error and can not solve it following OSS note.
    When I create a variable in query definition for an infoobject, it prompts an error dialog 'Inconsistent in loading. please check use of deleted objects'.
    I checked the OSS notes 792779, there is a such description:
    The variable existing in the table RSZGLOBV, but not existing in the tables RSZELTDIR or RSZCOMPDIR have inconsistent definition. These situation may return 2 different error messages. When a variable is missing in RSZELTDIR table (or in both together), an attempt to expand a list of variable under a corresponding InfoProvider or a list of text/formula variables will return a message 'Inconsistency in loading...'. All variables which are created for corresponding InfoProvider, text/formula variable are not available. When a variable is missing in the RSZCOMPDIR table only the error message is 'Missing UID XXXXXX... in RSZCOMPDIR! You may continue to work, but this component is not loaded' in Query Designer
    But I checked these tables RSZGLOBV and RSZELTDIR and RSZCOMPDIR. I can find a variable for this infoobject, such as TC_SREG, in these tables. That is, this variable should be availbale in the query definition.
    I don't know why.
    My sap bw is 3.1, without the program 'ANALYZE_RSZ_TABLES'.
    Many thanks for you help.

    Hi,
    While installing business content make grouping as Data Flow before and collection mode as 'Automatic'.  Then expand the Tree in the tree you can see Info Object Catalogue.  All installed and activated object will be in green (Active Mode). those will be normally unchecked to install anyway cross check and if found anything check deselect them.  Go for Simulation Installation to identify unforeseen errors.  Install the same and activate entire data-flow.
    Hope your issue will be resolve
    Thanks
    BVR

  • How to determine deleted objects in a transport

    Hi
    I create a new report Z_TEST_1 and assign this one to a new transport request.
    Now I rename this report to Z_TEST_1B
    In my transport are two entries:
    -Z_TEST_1
    -Z_TEST_2
    Now I read this objects with function module TR_READ_COMM
    Afterwards I want to analyse the objects of this transport
    But how can I see which objects exists and which not?
    I only need the (still) existing objects (in my test case: Z_TEST_2)
    I don't want to check every single object if this object still exists. I know I could check the entry in table TRDIR (for reports).
    But there are a lot more object kinds in my transport (function modules, dictionary objects, forms, table keys)....
    Does anyone have a simple solution for this problem?
    Thanks
    Andy

    Hello There.
    SE03 is for finding the existing objects according to your first question (for function modules, reports, etc).
    As your object is not imported or transported.
    You need to find your deleted objects in Transaction SE95.
    In the window beneath,
    1. Go to window, Reset Objects.
    2. Check the deleted objects.
    3. You can also mention your request or package.
    4. Execute.
    5. Go to Deleted objects node.
    6. Navigate to the node desired.
    7. You can also find the request related to that business object by clicking on find requests.
    These are the logs.
    If you have already tried out then its good or else give feedback.
    Good Luck & Regards.
    Harsh Dave

  • UnitOfWorkChangeSet and deleted objects

    I would like use the UnitOfWorkChangeSet for auditing changes made to the objects. It seams that the UnitOfWorkChangeSet contains new objects and updated objects, but I cannot find deleted objects. The function UnitOfWorkChangeSet.getDeletedObjects always returns an empty set.
    1) How to get deleted objects?
    2) Where can I find the best information about usage of the change sets?
    3) Can I process the change set after calling the method commit or is it better do it in any SessionEvent method (if so - which method should I use?)?
    Thank you in advance for any help
    Jan Kostrhun

    Hello Jan,
    For effeciency reasons the deleted objects are only placed in the UnitOfWorkChangeSet in the case of Cache Coordination (Cache Synchronization). If your application is not configured to use Cache Coordination the deleted objects can be found in unitOfWork.getObjectsDeletedDuringCommit(). Please note that this is an internal method in TopLink that may change in future released.
    Accessing the UnitOfWorkChangeSet after you have called commit is fine.
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to delete object in Integration Repository SAP PI 7.0

    how to delete object in Integration Repository SAP PI 7.0

    Hi Rashmi,
    Right click on the object, you would find the option to delete--> select it. Goto Changelist Tab and activate the changes.
    Ref: /people/siva.maranani/blog/2005/05/22/how-to-delete-software-component-from-integration-builder
    Re: How to delete/remove the software component from integration repository
    Thanks,

  • How to invoke BPM object instance variable from interactive activity?

    I have a screenflow with an automatic activity "A" followed by an interactive activity "B". "B" calls a BPM object "X" and uses a JSP presentation to show its attributes. Is there a way to use another BPM object, say type "Y", create an instance variable of that type inside "A", and get its attributes values from the JSP page associated to "B"?
    Edited by: user6473912 on 20/07/2010 03:37 PM

    Try this. It assumes you have:
    <li> a user named "auto"
    <li> a project variable named "customerType"
    <li> an instance variable named "orderAmount" that is a decimal
    <li> an instance variable named "order" that is a BPM Object that has attributes named "customerName" and "amount"
    ps as ProcessService
    xmlObject as Fuego.Xml.XMLObject
    do 
      connectTo ps
          using url = Fuego.Server.directoryURL,
          user = "auto",
          password = "auto"
      instF as InstanceFilter
      create(instF, processService : ps)
      addAttributeTo(instF, variable : "customerType", comparator : IS, value : "Gold")
      instF.searchScope = SearchScope(participantScope : ParticipantScope.ALL, statusScope : StatusScope.ONLY_INPROCESS)
      for each inst in getInstancesByFilter(ps, filter : instF) do
        // here's how to get the value inside a primitive instance variable
        orderAmtObj as Object = getVar(inst, var : "orderAmount")
        // here's how to get the value of attributes inside a complex BPM Object instance variable
        //    - in this case this is an "order" object with two attributes (customerName and amount)
        orderObj as Object = (getVar(inst, var : "order"))
        xmlObject = Fuego.Xml.XMLObject(createXmlTextFor(DynamicXml, object : orderObj, topLevelTag : "xsi"))
        logMessage "The value of the order object's customer name is: " +
               selectString(xmlObject, xpath : "customerName")
        logMessage "The value of the order object's order amount is: " +
               selectNumber(xmlObject, xpath : "amount")
        // here's a rather uninspired way to retrieve who the participant is that was assigned the instance
        logMessage "The participant assigned to this instance is: " + inst.participantId
      end
    on exit
      disconnectFrom ps
    endDan

  • OIM - Task Assignment Adapter - How to get the object instance key?

    Hello experts,
    I'm trying to use a task assignment adapter to assign an approval task dynamically. Basically, the user can request a resource like "CustomApp Profiles" and we create an object form to let them choose the profile that he needs. Each profile has an owner, which is populate in a Lookup (Owner is the code and Profile is the decode).
    So, in the approval task, I need to get the profile selected by user in the object form and search into the lookup who is the owner of that profile. But I don't know how can I get the object instance key using the parameters that can be mapped to a task assignment adapter.
    Looking into the OIM documents, I believe that the easier way is using the request key, because the REQ_KEY is a foreign key in OBI table.
    Did anyone knows how can I get the object instance key using the request key? Can I use some API or should I execute a SQL statement directly in OIM database?
    Best Regards,
    Nitto

    To retry a task that is in a rejected state, you use the SCH_KEY which is the task key.  In OIM, all rejected tasks are listed in the OTI table.  It contains all the important information about a rejected or pending task.
    You can use the APIs found in the tcProvisioningOperationsIntf class to retrieve open tasks.
    -Kevin

  • How can i have a refrence of a java class object instance in my c++ project

    Hi!
    How can i have a refrence of a java class object instance in my c++ project. Is there a way?

    hahaxia wrote:
    The second question is the big one. The first question is half of the problem of "c++ to java" invocation and access. But the other half which is "java to c++ " invocation and access is still not solved. jni only provide the "java to c++ " DLL invocation Wrong,
    Using JNI your java classes can have methods implemented in C/C++.
    Using JNI you can call java classes.
    There is no other possible interaction between C++ and java, so it does it all.

  • Archiving historical object instances

    Post Author: KevinR
    CA Forum: Administration
    Is there an automated way to archive historical object instances?  We are a financial institution and need to keep objects for several years, but don't want to keep so many objects available in WebI because we'll run out of room on our file server.  We only want to keep a years worth available to the users.  After a year, the instances will fall off based on our parameters, but he have to keep them (most likely on tape backups) available just in case we get audited.

    Thanks for the reply.
    We have around 900 tables in DB to Archive ....In both the options I have to have Date column in every table ....But when I checked that ....most of the tables does not have any date field on which I create a date range parition OR Pull the data to Archive tables.
    I think it is a expected DB ..as it is not necessary every table has data column.
    What should be the another approach in this condition?
    Another quesiton will be...if applicaiton wants the see the historic data, how that be possible.
    Edited by: user489466 on Apr 10, 2009 4:26 AM
    Edited by: user489466 on Apr 10, 2009 4:27 AM

  • Error - Trying to delete objects (Positions)

    Via Report RHRHDL00, I am trying to delete a few positions, I created for Testing.
    I am getting error u201C STOP: The information entered is incorrect, Cost Center missing . Please contact your SAP Rep before completing this.
    I am getting the same error via Tcode RE_RHRHDL00
    Why should I get this error, when I am just deleting objects?
    Please help.

    You can use the above report  to delete the OM object. However first remove the OM and PA integration  if the postion is still assigned and then execute.
    In case you want to delete the person completely you can use the program RPUDELPN.

Maybe you are looking for

  • Unable to form af:table in navigation Menu Model

    Hi, Am using jdeveloper 11.1.2.1.0, I have developed my project with reference to the link below http://www.youtube.com/watch?v=cInX_FMZJaQ Am unable to drag and drop a VO as af:table in my jspx pages. Could any one pls explain me where i went wrong?

  • Call Recorder ++ has suddenly started crashing & wont open

    ‎I have written to the App developer's tech support 4 times in a week now without the courtesy of a reply so.i thought I would try this board for help.  The app in question is Call Recorder ++ by Ajani InfoTech Private Limited. Version 2.0.0.1 The ap

  • Making ECR No. Compulsory While Changing Material BOM (T. Code CS02)

    Hi, In our business scenario, we want to make ECR No. compulsory while changing BOM using transaction code CS02. Process which we are looking at would be as below. 1)     Default initial status of BOM will be set as u20182u2019 (Inactive) through cus

  • Re-installation issue

    Hello and thanks in advance for your help. I have a macbook (not that it makes a differnce) and I had OSX 10.5. I repartitioned my hd (with nothing on it but a fresh copy of OSX) and I installed a partition of Ubuntu so I could have something to play

  • RMS Installation using Retail Templates from RA

    Hi, I have pre-installed RA 13.2.3, and now I need to install RMS 13.2.3 in the same server (64 bit environment). So, I'm thinking of installing RMS in a different database instance in the same Oracle Software. Can I use the same Retail Template from