Existing state of package discarded

Hi,
How can i avoid the error "Existing state of package discarded.." error.. my package is called from java front end and it gives error in front end. once, i refresh the page it starts working...
Thanks,
JP

This is caused by having package level variables in your package and then something that the package depends (dependencies) are changing in some way which invalidates the package.
If there are no package level variables then the package will automatically re-compile and be usable, but if there are package level variables then these are considered to be the "state" variables for that users session. When the package becomes invalidated for whatever reason, then it is basically saying "I can't recompile the package because you will lose the state of your copy of the variables" which is why the error is generated, and once you have been given the error, if you access it again it will cause it to recompile anyway.
One solution is to remove all package level variables (and constants) to a seperate package spec and alter the code of the package to reference them in that package spec.
;)

Similar Messages

  • Existing state of packages has been discarded...

    Hi all,
    I know this is a long shot and probably you need more details to help, but please take a look in case you've encountered something similar before... It is a pretty interesting problem.
    Ok, I have two packages, say, A and B. Package A is composed of utility functions, and package B makes use of those functions. These packages are compiled as part of the schema installation, where package A is always compiled first. I also have unit test scripts for each procedure in each package.
    Now, after schema installation, when I run the unit test for some procedures in package B, I get the following error:
    ORA-04068: existing state of packages has been discarded
    ORA-04065: not executed, altered or dropped stored procedure "my_schema.pkg_A"
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at "my_schema.pkg_B", line 18
    ORA-06512: at line 5
    Some interesting notes:
    - I can run the unit test of all pkg A procedures. I can also describe the package. Which seems to me that pkg A has been compiled successfully.
    - If I log into a sqlplus session, run the unit test for a pkg B procedure, which then fails with the above message. Then I run a unit test of a pkg A proceudre, which succeeds. Then I run the same pkg B unit test, it will work then. And all the other pkg B procedures will work from this point on.
    - But if I log out from sqlplus session, and log in again, and run the pkg B procedure unit test again, it will fail as before.
    - Certain procedures in pkg B have no problem running. They also call pkg A procedures. However, the pkg A procedures are always invoked in the where or order by clauses in these cases. The pkg B procedures that call pkg A procedure in a standalone statement will always fail.
    - The fact above made me suspect that function-based indexes (which were created using pkg A procedures) were used in cases where pkg B procedures work. And that in those cases pkg A hasn't really been invoked. However, when I monitor those indexes using v$object_usage, it shows they are not used. (I have a very small set of data.)
    - After schema installation, if I compile pkg B again, the problem will disappear.
    Does this ring a bell to anyone? Any help will be appreciated.
    Thanks,
    Gloria Chung

    Thanks for reading and responding.
    I'm compiling both header and body for both packages.
    I ran the following query after schema installation, which returned 0:
    select count(*) from user_objects where status='INVALID';
    The schema installation involved putting new copies of both package A and B.
    If I only recompile the package body after installation, it will still 'cure' the problem. I.e. if I run any of the affected pkg B unit test, it will run successfully.
    It is assumed there is no schema before 'schema installation'.
    Thanks,
    Gloria

  • Existing state of package has been discarded...

    If application is running and it uses cursors/prepared statements for procedures and functions in packages and
    new version of package is inserted into database, then an error message 'existing state of package has
    been discarded' is raised.
    However, there are packages where there is no 'existing state of package'. And for application purposes
    new version of this package should be used without this error message.
    Enhancement: There should be a pragma stating that package is 'stateless' and new version ot it is used if it
    exists without an error situation.
    This feature would be beneficial e.g. in 3-tier architecture where servers are running constantly.
    Or can this be accomplished with any other way (without parsing statement with every call ) ?

    When session references a package for the first time package is instantiated in session memory. If package is recompiled since, Oracle assumes it possibly changed and package instance in session memory is no longer valid. That's why any reference to that package made by such session will raise an error.
    Session 1:
    SQL> create or replace
      2  package pkg1
      3  is
      4  g_n number;
      5  procedure p1;
      6  end;
      7  /
    Package created.
    SQL> create or replace
      2  package body pkg1
      3  is
      4  procedure p1
      5  is
      6  begin
      7  for rc in (select * from emp) loop
      8  dbms_output.put_line(rc.empno);
      9  end loop;
    10  end;
    11  end;
    12  /
    Package body created.
    SQL> exec pkg1.p1;
    PL/SQL procedure successfully completed.
    SQL>This instantiated package PKG1 is session1. Then session 2:
    SQL> alter package pkg1 compile body;
    Package body altered.
    SQL> Back to session 1:
    SQL> exec pkg1.p1;
    BEGIN pkg1.p1; END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "SCOTT.PKG1" has been invalidated
    ORA-04065: not executed, altered or dropped package body "SCOTT.PKG1"
    ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.PKG1"
    ORA-06512: at line 1
    SQL>SY.

  • ORA-04068: existing state of packages has been discarded

    I work on an order entry system that is up 24x7 running Oracle version 8.0.5. I want to compile a fix to a procedure contained in a package body. I only will be recompiling the package body. Since the package body has no dependent objects, I should not invalidate any stored procedures that call this procedure in my package. However, should I worry about causing an "ORA-04068: existing state of packages has been discarded" error? What causes this error and when does it occur?

    Please ensure that DBMS_ROWID is created in SYS schema and not in any ordinary user's schema. If it exists in any user's schema drop it from there.
    If the problem persists, drop the package from sys schema as well and run two script files in the following order:
    1) ORACLE_HOME\rdbms\admin\dbmsutil.sql
    2) ORACLE_HOME\rdbms\admin\prvtutil.plb

  • ORA-4068 Existing stage of package discarded - Techniques of avoid variable

    Hi all,
    I need to ‘strip’ the state from a package (let’s say PKG_MAIN). I’ve already transform all constants into functions but I have difficulties in finding the best solution for the variables. Most of the variables are collections and I cannot use temporary tables to replace them (performance issues). As well I have tried creating a package (PKG_VARIABLES) for all variables but, as you probably know, this is not a ‘fix’ because changing the PKG_VARIABLES will trigger, when calling the PKG_MAIN, the ORA-4068 anyway.
    Any ideas??
    Cheers,
    Harada

    [standard response for package state]
    Packages tend to fail because of their "package state". A package has a "state" when it contains package level variables/constants etc. and the package is called. Upon first calling the package, the "state" is created in memory to hold the values of those variables etc. If an object that the package depends upon e.g. a table is altered in some way e.g. dropped and recreated, then because of the database dependencies, the package takes on an INVALID status. When you next make a call to the package, Oracle looks at the status and sees that it is invalid, then determines that the package has a "state". Because something has altered that the package depended upon, the state is taken as being out of date and is discarded, thus causing the "Package state has been discarded" error message.
    If a package does not have package level variables etc. i.e. the "state" then, taking the same example above, the package takes on an INVALID status, but when you next make a call to the package, Oracle sees it as Invalid, but knows that there is no "state" attached to it, and so is able to recompile the package automatically and then carry on execution without causing any error messages. The only exception here is if the thing that the package was dependant on has changes in such a way that the package cannot compile, in which case you'll get an Invalid package type of error.
    And if you want to know how to prevent discarded package states....
    Move all constants and variables into a stand-alone package spec and reference those from your initial package. Thus when the status of your original package is invlidated for whatever reason, it has no package state and can be recompiled automatically, however the package containing the vars/const will not become invalidated as it has no dependencies, so the state that is in memory for that package will remain and can continue to be used.
    As for having package level cursors, you'll need to make these local to the procedures/functions using them as you won't be able to reference cursors across packages like that (not sure about using REF CURSORS though.... there's one for me to investigate!)
    This first example shows the package state being invalided by the addition of a new column on the table, and causing it to give a "Package state discarded" error...
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  /
    Table created.
    SQL>
    SQL> insert into dependonme values (5)
      2  /
    1 row created.
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  /
    Package created.
    SQL>
    SQL> create or replace package body mypkg is
      2    v_statevar number := 5; -- this means my package has a state
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
    10
    11      myval := myval * v_statevar;
    12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
    13    end;
    14  end mypkg;
    15  /
    Package body created.
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALID
    SQL>
    SQL>
    SQL> alter table dependonme add (y number)
      2  /
    Table altered.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    BEGIN mypkg.myproc; END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "SCOTT.MYPKG" has been invalidated
    ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.MYPKG"
    ORA-06512: at line 1
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALIDAnd this next example shows how having the package variables in their own package spec, allows the package to automatically recompile when it is called even though it became invalidated by the action of adding a column to the table.
    SQL> drop table dependonme
      2  /
    Table dropped.
    SQL>
    SQL> drop package mypkg
      2  /
    Package dropped.
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  /
    Table created.
    SQL>
    SQL> insert into dependonme values (5)
      2  /
    1 row created.
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  /
    Package created.
    SQL>
    SQL> create or replace package mypkg_state is
      2    v_statevar number := 5; -- package state in seperate package spec
      3  end mypkg_state;
      4  /
    Package created.
    SQL>
    SQL> create or replace package body mypkg is
      2    -- this package has no state area
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
    10
    11      myval := myval * mypkg_state.v_statevar;  -- note: references the mypkg_state package
    12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
    13    end;
    14  end mypkg;
    15  /
    Package body created.
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        VALID
    SQL>
    SQL> alter table dependonme add (y number)
      2  /
    Table altered.
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  /
    OBJECT_NAME
    OBJECT_TYPE         STATUS
    MYPKG
    PACKAGE             VALID
    MYPKG
    PACKAGE BODY        INVALID
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    PL/SQL procedure successfully completed.

  • ORA-04061: existing state of  has been invalidated

    Hi,
    In Development Database Information
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE     11.2.0.2.0     Production"
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Solution required for this oracle error
    I am getting this Error - ORA-04061: existing state of has been invalidated
    package pkg1 -> Main pkg
    pkg1 calling another package pkg2
    i am modified and recompiled the package pkg2.
    After executing the package PKG1 it throwing this Error ORA-04061.
    i am checking user_objects and it status are VALID.
    In both package doesnt have the any variables.
    Please suggest the above issue.
    Thanks in advance.
    Regards,
    Sudhakar P

    BluShadow wrote:
    Karthick_Arp wrote:
    Sudhakar P wrote:
    Hi,
    how to reload it into memory - SGA ?.Please suggest me.
    Regards
    Sudhakar P.I guess you dint get my point. So may be read this {message:id=3488533}:) Saves me re-posting it.Still remember reading it way back then :). I much appreciate the time you spend on explaining it in detail.

  • Removing a child of an existing State in actionScript

    I want to remove a child of an existing State in actionScript
    here is what i have so far
    var removeChild:RemoveChild = new RemoveChild();
    removeChild.target = botMenu;
    But i don't know how to apply it
    thx

    I want to remove a child of an existing State in actionScript
    here is what i have so far
    var removeChild:RemoveChild = new RemoveChild();
    removeChild.target = botMenu;
    But i don't know how to apply it
    thx

  • Import statement reports 'package does not exist'

    I am seeing another odd error. I'm working on learning how to read and write to text files, and I have 2 errors reported, but one is obviously caused by the other. My package is labeled as such (copy>paste of package line):
    package michaelchristopherp4db;
    and the import line is this (copy>paste again):
    import michaelchristopherp4db.ProductRecord;
    However, Netbeans looks at the import and flags it red, saying package michaelchristopherp4db does not exist. this caused my line:
    ProductRecord product = new ProductRecord();
    to also be flagged in red as it cannot find the ProductRecord class. However, it has no problems with any of the product.get* method calls. Thank you in advance for any ideas or input.
    here is the full code of the file reporting the errors.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package michaelchristopherp4db2;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.lang.IllegalStateException;
    import java.lang.SecurityException;
    import java.util.NoSuchElementException;
    import java.util.Formatter;
    import java.util.FormatterClosedException;
    import java.util.Scanner;
    import michaelchristopherp4db.ProductRecord;
    /*  @author info
    public class readTxt
        private Scanner txtfile;
        private Formatter wishList;
        private Formatter giftIdeas;
        private Formatter priceError;
        //let user open file
        public void openFile()
        {//open method openFile
            try
            {//open try block
                priceError = new Formatter("priceerror.txt");//open object for items with invalid prices
                giftIdeas = new Formatter("giftideas.txt");//open object for gift ideas
                wishList = new Formatter("wishlist.txt");//open object for wish list
                txtfile = new Scanner(new File("products.txt"));//tell the compiler which file to use for input
            }//close try block
            catch (FileNotFoundException fileNotFoundException)
            {//open file not found catch block
                System.err.println("Error opening or creating file.");
                System.exit(1);
            }//close file not found catch block
            catch ( SecurityException securityException )
            {//start catch for SecurityException
                System.err.println("File Write access is denied.");
                System.exit(1);//END PROGRAM
            }//end catch
        }//close openFile method
        public void readProducts()
        {//open readProducts method
            ProductRecord product = new ProductRecord();//create object to hold read data
            //print headers for for output columns
            System.out.printf("%-10s%-12s%10s\n", "Product ID", "Product Name", "Price");
            try //read records from the file
            {//open try block
                while (txtfile.hasNext())
                {//open while
                    product.setproductID(txtfile.nextInt());//get productID
                    product.setproductName(txtfile.next());//get product name
                    product.setproductPrice(txtfile.nextDouble());//get product price
                    //print collected product details
                    System.out.printf("%-10d%-12s%10.2f\n", product.getproductID(),
                            product.getproductName(), product.getproductPrice());
                    if (product.getproductPrice()>50.0)
                    {//open if to store items $50 or more to wishlist.txt
                        wishList.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close if $50 or greater
                    else if (product.getproductPrice()<0.0)
                    {//open if less than zero
                        priceError.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close if less than zero
                    else
                    {//open else for gift ideas from $0 to $50
                        giftIdeas.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close else for gift ideas
                }//close while
            }//close try block
            catch (NoSuchElementException elementException)
            {//open no such element exception catch
                System.err.println("File improperly formed.");
                txtfile.close();//close text file
                System.exit(1);
            }//close no such element exception catch
            catch (IllegalStateException stateException)
            {//open illegal state exception catch
                System.err.println("Error reading from file.");
                System.exit(1);
            }//close illegal state exception catch
        }//close readProducts method
        //close file and end application
        public void closeFile()
        {//open closeFile method
            if (txtfile != null)
                txtfile.close();//close file
        }//close closeFile method
    }//end application readTxtAnd the code at the top of the class I am trying to import (so you can see the package I am trying to import)
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package michaelchristopherp4db;
    *  @author
    public class ProductRecord {

    I am embarrassed to admit this, but I am completely lost on the last question.. I have no clue wether it is a convenience for development or a dependancy, as I have not learned those terms or distinctions yet. For now I copied the ProductRecord file into my new project folder and renamed it's project line to match the new project name. However, while that eliminated the package does not exist error, and netbeans reports no errors now, when I run the program it does not write the new files. I have made some modifications to the code tryiing to get it to write properly but so far no luck in makingit work. Here is the current version of the file not running right.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package michaelchristopherp4db2;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.lang.IllegalStateException;
    import java.lang.SecurityException;
    import java.util.NoSuchElementException;
    import java.util.Formatter;
    import java.util.FormatterClosedException;
    import java.util.Scanner;
    /*  @author
    *   Michael Christopher
    *   IT215-1004D-03
    *   December 30, 2010
    *   Phase 4 DB 2
    public class readTxt
        private Scanner txtfile;
        private Formatter wishList;
        private Formatter giftIdeas;
        private Formatter priceError;
        //let user open file
        public void openFile()
        {//open method openFile
            try
            {//open try block
                priceError = new Formatter("priceerror.txt");//open object for items with invalid prices
                giftIdeas = new Formatter("giftideas.txt");//open object for gift ideas
                wishList = new Formatter("wishlist.txt");//open object for wish list
                txtfile = new Scanner(new File("products.txt"));//tell the compiler which file to use for input
            }//close try block
            catch (FileNotFoundException fileNotFoundException)
            {//open file not found catch block
                System.err.println("Error opening or creating file.");
                System.exit(1);
            }//close file not found catch block
            catch ( SecurityException securityException )
            {//start catch for SecurityException
                System.err.println("File Write access is denied.");
                System.exit(1);//END PROGRAM
            }//end catch
        }//close openFile method
        public void readProducts()
        {//open readProducts method
            ProductRecord product = new ProductRecord();//create object to hold read data
            //print headers for for output columns
            wishList.format("%-10s%-12s%10s\n", "Product ID", "Product Name", "Price");
            giftIdeas.format("%-10s%-12s%10s\n", "Product ID", "Product Name", "Price");
            priceError.format("%-10s%-12s%10s\n", "Product ID", "Product Name", "Price");
            try //read records from the file
            {//open try block
                while (txtfile.hasNext())
                {//open while
                    product.setproductID(txtfile.nextInt());//get productID
                    product.setproductName(txtfile.next());//get product name
                    product.setproductPrice(txtfile.nextDouble());//get product price
                    if (product.getproductPrice()>50.0)
                    {//open if to store items $50 or more to wishlist.txt
                        wishList.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close if $50 or greater
                    else if (product.getproductPrice()<0.0)
                    {//open if less than zero
                        priceError.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close if less than zero
                    else
                    {//open else for gift ideas from $0 to $50
                        giftIdeas.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close else for gift ideas
                }//close while
            }//close try block
            catch (NoSuchElementException elementException)
            {//open no such element exception catch
                System.err.println("File improperly formed.");
                txtfile.close();//close text file
                System.exit(1);
            }//close no such element exception catch
            catch (IllegalStateException stateException)
            {//open illegal state exception catch
                System.err.println("Error reading from file.");
                System.exit(1);
            }//close illegal state exception catch
        }//close readProducts method
        //close file and end application
        public void closeFile()
        {//open closeFile method
            if (txtfile != null)
                txtfile.close();//close file
        }//close closeFile method
    }//end application readTxtwith the System.out.printf lines in the ReadProducts method it would properly print to screen all of the elements in the products.txt file, it is not outputting to the other .txt files at all. I will be exploring the closeFile method in case the error is due to not closing all of the files in that method, but does anyone else see what might cause it not to output the data to the appropriate .txt files?

  • [1.1.1.25.14] Refiltering packages discards existing package decomposition

    I am having problems with the package decomposition for already decomposed packages being discarded when refiltering the packages. Filtering out the previously decomposed package and then filtering it back in doesn't fix it and neither does disconnecting and reconnecting. The only thing that seems to fix it is a SQL Developer restart.
    This makes it very frustrating to work through code called by a procedure in a set of tightly integrated packages (I am on an Oracle Apps site).

    you were talking about refreshing and I was getting the problem when refilteringYou're right, the problem is more extensive than I initially experienced. Thanks for pointing that out.
    the thread went off on a tangentHehe, I did got buried there, but resurfaced near the end ;-)
    Let's hope we've done a better job in catching the attention this time.
    Thanks,
    K.

  • Problem with ORA-04061: Existing state of string has been invalidated Tips

    hi,
    i'm a oracle developer and work in a IRON Industry, in our industry we have several levels of data communications, in our level 2, all of software developed on .NET platform, and in level 3 we have oracle tools such as form builder, we have a connector called ICC that developed in .Net platform, ICC gathers datas from level 2 on tcp/ip and write in a oracle database(level 3), a BEFORE INSERT trigger wrote on a table that ICC insert into it datas and calls several packages in the level 3, we have oracle database 10g R2, in this database if state of one of dependent procedures or functions that called in main package changed to INVALID then this trigger doesn't work, if any body have any suggestion to change our solution please help me.
    Thanks alot

    Arash wrote:
    hi,
    i'm a oracle developer and work in a IRON Industry, in our industry we have several levels of data communications, in our level 2, all of software developed on .NET platform, and in level 3 we have oracle tools such as form builder, we have a connector called ICC that developed in .Net platform, ICC gathers datas from level 2 on tcp/ip and write in a oracle database(level 3), a BEFORE INSERT trigger wrote on a table that ICC insert into it datas and calls several packages in the level 3, we have oracle database 10g R2, in this database if state of one of dependent procedures or functions that called in main package changed to INVALID then this trigger doesn't work, if any body have any suggestion to change our solution please help me.
    Thanks alotThis probably is not specific to your .NET application. If you can reproduce this from SQL*Plus please post this over on one of the OTN database forums, as there a lot more DBAs over there who could potentially help you.

  • Global Defined Table - Existing for single package only or for all package

    Hi Folks,
    I got a question around global fields in start routines of transformations.
    Lets say I have defined in the global section a table that should hold some lookup values retrieved in the start routine (e.g. material attributes for all material number entries in the data package). Later this table is used in the transformation to "fill fields" for the target cube.
    Will this table be "initiated" for every package so it will hold only the data the start routine put there.
    Or is it "existing" throughout the whole update process and every new package will "add" records there so overtime it will grow from package to package?
    Thanks and best regards,
    Axel

    Use a simple trick to get around.
    IF sy-uzeit < 060000.
       load_date = sy-datum - 1.
    ELSE.
      load_date = sy-datum.
    ENDIF.
    Edited by: Dirk Herzog on May 24, 2011 10:44 AM

  • How to check if an object exists and how to discard it?

    Greetings,
    I have a main GUI panel in a JFrame that creates a smaller JFrame with a progress bar and text area whenever a process is initiated. I've set the default close operation to DISPOSE_ON_CLOSE as when I set it to EXIT_ON_CLOSE the main GUI panel closes as well (!). But whenever I'm closing the smaller JFrame and initiate a new thread, then the same operation is perform in parallel 2, 3 ,4 times, etc. It seems that the object of the class ProgressGUI which carries all the components of the small panel is not disposed properly. So my question is how can I check if an object exists and if yes how can I discard it? Or in other words how can I discard the JFrame of the small panel without closing the main GUI panel as well?
    thanks,
    Thomas

    I've set the default close operation to DISPOSE_ON_CLOSE thats right.
    So my question is how can I check if an object exists Whenever you create an object, save its refrence somewhere, then just check
    if(reference==null){
             //object does not exist
    }else {
            //object exists
    and if yes how can I discard it? Ensure that no references of the object to be discarded are remaining with any of the objects and then believe in 'Garbage Collector' to do the job! e.g. if there is only one reference to the frame (in your case) somewhere, you can just make an assignment like:
    reference=null;by doing this, you have made the object a candidate for garbage collection. Rest is done by 'Garbage Collector', not you.
    For cases like yours, it is better to make the small frame just once and whenever required just make the frame visible.
    e.g.
    JFrame smallFrame;
    void showSmallFrame(){
        if(smallFrame==null)smallFrame=new SmallFrame(); //or something like that
        smallFrame.setVisible(true);
    }Thanks!

  • Importing existing classes loses package identity in 9.0.2

    I have tried several ways, but everytime I import existing classes, they all go to Miscellaneous Files and won't display under their packages. This is from disk or from source code control (CVS). This works fine with the same exact classes and directories under JDeveloper 3.1.1. It seems simple, but it is frustrating. Any suggestions?

    Hi,
    This is normally because the Source Path setting (under Common->Input Paths in project settings) is not set to the correct directory. You should get a prompt asking if you want to add the correct path to the source path when adding files to a project.
    Thanks,
    Brian

  • How to avoid or replace a sub query from Exists statement.

    Hello all,
    I have a query regarding sql query.
    DB 1
    Table A                                 Table B
    ID   Code   HeaderID            ID   
    1    100      1                          1
    2    200      1                          2
    3    100      2                          3
    DB 2
    Table C
    ID    Code  Type
    1     100     1
    2     101     1
    3     100     2
    set @HeaderID = 1
    IF EXISTS (SELECT Code From Table A WHERE HeaderID=@ID AND Code  not in (SELECT Code FROM Table C WHERE Type=1))
    BEGIN
    RAISERROR('code is not set.',16,1)
    END
    Table A and Table C are in different databases say DB1 and DB2.
    How can we replace this with another query using join or something. Can we do it using one query by avoiding sub query.I want to get Code 200 which is not match with Table C Code.
    Regards, Ranjith T Rajan Acty System India Pvt Ltd.

    Instead of checking later and raising an error you can create a check constraint on the table so that it raises error when you insert the non existent code itself.
    You can create a UDF like below
    CREATE FUNCTION CheckCodeExistence
    @Code int,
    @HeaderID int
    RETURNS bit
    AS
    BEGIN
    DECLARE @Ret bit
    SELECT @Ret = CASE WHEN NOT EXISTS (SELECT 1
    FROM DB2.dbo.TableC
    WHERE Code = @code
    AND [TYPE] = @headerID)
    THEN 0
    ELSE 1 END
    RETURN(@ret)
    END
    Then create a check constraint on Table A based on it as
    ALTER TABLE TableA ADD CONSTRAINT Chk_TableA CHECK (dbo.CheckCodeExistence(Code,HeaderID) =1 )
    Now when you try to insert record with Code 200 you'll get the below
    Msg 547, Level 16, State 0, Line 1
    The INSERT statement conflicted with the CHECK constraint "Chk_TableA". The conflict occurred in database "DB1", table "dbo.TableA".
    The statement has been terminated.
    See similar example here
    http://visakhm.blogspot.in/2012/05/implementing-multiple-table-based-check.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Free addition to an already existing print subscription package?

    Can one provide work created with iBooks Author as a FREE ADDITION to an already existing subscription package? No rise in the subscription cost would occur if this were added. This would be a free addition for subscribers to download for free. This would act as a free digital option/addition to the print subscription. Possible? I know you can distribute the iBook Author work for free, but wanted to ask if it could be free inside of an existing subscription pacakge that is not conneted to iTunes or the iBooks store.

    Does this apply?
    http://support.apple.com/kb/HT5071#3
    Can I distribute works created with iBooks Author as part of a product or service that charges a subscription-based fee?
    Books created with iBooks Author may not be sold as part of a subscription-based product or service. iBooks Author books must be distributed free of charge or made available for sale via the iBookstore.

Maybe you are looking for

  • Error while Loading the validator-rules.xml in Struts 1.2

    Hello Guys, I am trying to use the Struts 1.2.4 on Jdk1.3 inside WSAD5.1 and i get the following error when loading the application. It breaks on the fist line inside validator-rules.xml witht hte following error. My first line in the validator-rules

  • Looking for  Weblogic Server 5.1 Licenses & Software

    Hi I'm currently trying to get hold of a WebLogic Server 5.1 (and a license) to run on a live (hosted) web application server in the UK (in fact it needs to be for 2 licenses - since it will end up on a Solaris E220 which contains 2 CPUs). Has anyone

  • Install JCRM

    Hello Guys; I have a CRM Server as ABAP and i need to install the JCRM (E-Commerce). Have i install a netweaver for JAVA? or Have I a java add-in to CRM Server? is it necesary to install a j2ee standalone? This instalation is for Development, but in

  • My network extender gps and sys light is blinking red .What can I do to fix it?

    How can I fix my network extender ?

  • Transaction for Mass Update

    Hi, Can anyone List out some Standard SAP transactions that are doing mass update. Means Transactions which are updating a range of records in single shot. Instead of doing it one by one. I need to create a Mass update for Material. What MM02 do for