Is there a concept of initialization in package?

Hi,
I am trying to simulate object initialization in package.
CREATE OR REPLACE PACKAGE PKG_TEST AS
FUNCTION abc RETURN DATE;
FUNCTION def RETURN DATE;
FUNCTION ghi RETURN DATE;
END;
CREATE OR REPLACE PACKAGE BODY PKG_TEST AS
  FUNCTION abc RETURN DATE IS
  BEGIN
   RETURN SYSDATE;
  END;
  FUNCTION def RETURN DATE IS
  BEGIN
   RETURN SYSDATE-1;
  END;
  FUNCTION ghi RETURN DATE IS
  BEGIN
   RETURN SYSDATE-2;
  END;
BEGIN
  DBMS_OUTPUT.put_line('Body executed');
END;
--test script
-- Created on 21/12/2007 by TANBKT
declare
  -- Local variables here
  i integer;
begin
  -- Test statements here
  for x in 1..2 loop
   DBMS_OUTPUT.put_line('abc:'||PKG_TEST.abc);
   DBMS_OUTPUT.put_line('abc:'||PKG_TEST.def);
   DBMS_OUTPUT.put_line('abc:'||PKG_TEST.ghi);
  end loop;
end;
--Output
Body executed
abc:21-DEC-2007
abc:20-DEC-2007
abc:19-DEC-2007
abc:21-DEC-2007
abc:20-DEC-2007
abc:19-DEC-2007The above shows that the message "Body executed" was printed only once, somehow similar to object/class constructor(i am referring to Java).
Is it safe to deduce above conclusion? Will there be any cases when the message "Body executed" will not be printed at all? (in other words, the initialization didn't take place)
Thanks.

> Is it safe to deduce above conclusion?
Yes and no.
Yes, the main body of a package is executed when the package is loaded. A package is similar to a shared object or dynamic link library - it gets loaded once into session memory (when used) and stays there until unloaded.
The no part - this relates to the "unloaded" portion. PL/SQL state memory can be reset - and under certain circumstances (like re-using sessions for stateless clients) this is usually a given. The package can be invalidated due to an dependent object being "touched" (DDL) - in which case the session state will also be invalid and the package will be recompiled and reloaded.
Thus the "safeness" of your deduction depends on what you want to do using this "load/constructor" feature of packages.

Similar Messages

  • How can I solve a Parse Error: "There was a problem parsing this package"

    Hello;
    I developed a really simple app in Flash Pro CC for android. I published it using AIR 13.0 for Android. When I tried to install it I received the Parse Error: "There was a problem parsing this package"
    Im not sure if the problem has something to do with my app xml file, but here it is:
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://ns.adobe.com/air/application/13.0">
         <id>TOeatorNOTTOeat</id>
         <versionNumber>1.0.0</versionNumber>
         <versionLabel>TouchEvent</versionLabel>
         <filename>TO eat or NOT TO eat</filename>
         <description/>
         <name>TO eat or NOT TO eat</name>
         <copyright/>
         <initialWindow>
              <content>TO%20eat%20or%20NOT%20TO%20eat.swf</content>
              <systemChrome>standard</systemChrome>
              <transparent>false</transparent>
              <visible>true</visible>
              <fullScreen>true</fullScreen>
              <aspectRatio>landscape</aspectRatio>
              <renderMode>gpu</renderMode>
              <autoOrients>false</autoOrients>
         </initialWindow>
         <icon>
              <image36x36>icons/icon36x36.png</image36x36>
              <image48x48>icons/icon48x48.png</image48x48>
              <image72x72>icons/icon72x72.png</image72x72>
              <image96x96>icons/icon96x96.png</image96x96>
         </icon>
         <customUpdateUI>false</customUpdateUI>
         <allowBrowserInvocation>false</allowBrowserInvocation>
        <android>
              <manifestAdditions>
                   <![CDATA[<manifest> </manifest>]]>
              </manifestAdditions>
         </android>
         <supportedLanguages>en</supportedLanguages>
    </application>
    What do you think is the best to check?

    i don't see any problem with your manifest.
    try saving your fla and the published files to a new directory and see if the error resolves.

  • How  to verify yum configuration  in OEL . is there any way  to rollback the package

    Hi ,
    How we can verify  the yum configurtion . is there any way to rollback the package using yum
    Also  let me know how to rollback packages that upgraded using up2date .

    Hi ,
    There is nothing  in  yum.repos.d directory  and  below are  entries in /etc/yum.conf file . can you  please  cnfirm wherther yum is configured or not
    yum.repos.d]# ls -ltrh
    total 0
    #cat /etc/yum.conf
    [main]
    cachedir=/var/cache/yum/$basearch/$releasever
    keepcache=0
    debuglevel=2
    logfile=/var/log/yum.log
    exactarch=1
    obsoletes=1
    gpgcheck=1
    plugins=1
    installonly_limit=3
    #  This is the default, if you make this bigger yum won't see if the metadata
    # is newer on the remote and so you'll "gain" the bandwidth of not having to
    # download the new metadata and "pay" for it by yum not having correct
    # information.
    #  It is esp. important, to have correct metadata, for distributions like
    # Fedora which don't keep old packages around. If you don't like this checking
    # interupting your command line usage, it's much better to have something
    # manually check the metadata once an hour (yum-updatesd will do this).
    # metadata_expire=90m
    # PUT YOUR REPOS HERE OR IN separate files named file.repo
    # in /etc/yum.repos.d

  • Is there any restriction using pl/sql packages depending on Oracle Version?

    Hi everybody. Our company is using a mix of pl/sql packages to call web services and process xml inside stored procedures. We are using UTL_HTTP, UTL_DBWS and UTL_XML. Our client asks if there is any restriction using those packages on a Standard One licensed database? Does we need an upgrade p.e. enterprise edition to use those packages? I test all our development on a Express Edition, and there is no restriction. We run the same test on a Standard One and Enterprise Editions and the result was the same, no restrictions.
    To use those packages does we need an upgrade to enterprise edition?
    Xavier.

    the packages that you mention are not restricted to a particular version.

  • Suppose in a Package Spec there are 3 functions and Package Body there are 5 functions will the package compile?

    Suppose in a Package Spec there are 3 functions and Package Body there are 5 functions will the package compile?

    Rather than asking these basic one-liner questions (When a package is created how many database objects are created?) why don't you explain what issues you are experiencing after you've read the documentation and tried things yourself.
    The forums are for people to help when they experience issues, not when they can't be bothered to read the documentation or searcht the web for the basic information that's already explained.
    Re: 2. How do I ask a question on the forums?
    Re: 1. Where can I find Oracle Documentation?

  • Is there an open FREE Math/Stat package for J2SE available?

    Hi,
    I asked something similar before, but my question was not as clear as now: Is there an open FREE Math/Stat package for J2SE available?
    If yes, can this package do multiple linear regression?
    If yes, where can it be downloaded from?
    Thanks, rasped

    yes but cannot do regression.
    yet have the matrix classes necessary to do your own regression classe.
    http://hoschek.home.cern.ch/hoschek/colt/

  • I s there any concept relating to Schema in HFM?

    Hi Peers?
    Please guide me is there any concept in HFM relating to Schema? The purpose of this?Where to use?Why?

    Hi Lee!
    I'm thinking to use 1260 AP.
    As I know now, there is some antennas which can operate in this temperature range : from  -30° to  +70° C.
    It is AIR-ANT5160V-R for 5GHz range:
    http://www.cisco.com/en/US/docs/wireless/antenna/installation/guide/ant5160v.pdf
    And AIR-ANT2506 for 2.4GHZ range :
    http://www.cisco.com/en/US/docs/wireless/antenna/installation/guide/ant2506.html
    But these are high gain antennas. I need to cover just little outdoor coffe
    Because I never tried this, I can't predict interoperability with 1260 AP also.
    Thanks for your time, answer and opinion guys !

  • ITunes x64 does not install in Windows 7. Shows that there is problem with windows installer package

    These images below show the error message I retrieve. I downloaded iTunes 10.5 x64 Edition for windows from Apple Official Website. When I try to install, it shows me these errors. I even tried removing the old version iTunes, and installing this version. But still the same error occurs. Even used windows cleanup utility to remove all itunes and quicktime related files. Still the same problem occurs. I also noticed a difference in this installation compared to the previous ones. In the previous version installation a segment of Apple Terms & Conditions Agreement will appear. But in this installer package, as you can see in the images provided it does not appear. How to solve this? I've been trying to install this for nearly a month.

    Nowadays people don't back up to CD/DVD. They get an *external hard drive* and copy over their entire iTunes folder, and whatever else they are backing up.
    The advantages are (1) this method does not depend on iTunes's horribly unreliable burning capability (2) you can look at the external and see that the stuff you backed up is really there. (If you want to see an unhappy person, it is when they try to restore from CD/DVD and discover that it did not burn correctly in the first place.) (3) it lets you back up your other valuable files besides your music.

  • Oracle Reports : Run time error when there is a call to DBMS_LOB package

    I am facing a strange issue, please do share if you have some inputs. When I try running the compiled RDF report(Generating XML to be specific), Oracle Reports Builder crashes when I make use of the following formula function. Strangely, this works fine in the backend. Moreover I tried debugging and by trial and error method found out that, when there is a call to the DMBS_LOB package it errors (works fine when this is commented). Please do let me know whats the root cause of this issue. Thanks in advance
    function CF_ClientSignatureFormula return VARCHAR2 is
    file_name BFILE;
    dir_name VARCHAR2(100);
    dest_file_name VARCHAR2(100);
    dest_path VARCHAR2(400);
    begin
         SELECT client_signature
              INTO file_name
              FROM xxfpr.fpr_rcp_bank_details frb,
              Xxfpr. fpr_rcp_gtn_rpt_map frm
              WHERE frb.record_id = frm.bank_record_id
              AND frm.gtn_request_id = :p_gtn_request_id;
    SYS.DBMS_LOB.filegetname(file_name,dir_name,dest_file_name);
    SELECT directory_path INTO dest_path FROM all_directories where directory_name = dir_name;
    dest_path := dest_path || '/' || dest_file_name;
    return dest_path;
    EXCEPTION
         WHEN OTHERS THEN
              RETURN NULL;
    end;
    Thanks,
    NirmalGeo

    And what version of Reports are you using?
    BFILES are accessible from the database, not the client (Reports). So, put your code in the database.

  • Is there a concept of an uninstaller on a Mac?

    Or perhaps a way to take an action if your program dragged to the trash can or being deleted?
    The reason I ask this is that my app installer puts files in a few places in the system and I would like to cleanup if my app is being deleted / thrown in the trash. On Windows you have the Add/Remove programs, and on OS X you just have installer packages, but no uninstaller mechanism that I know of.

    TheSilverHammer wrote:
    I am not sure what a BOM is. I just used the basic package maker tool and wrote a simple pre and postflight script.
    It is a Bill Of Materials file. PackageMaker creates them as part of your installer package. The Installer saves them in your Receipts folder so that (non-Apple) tools can clean up later. The important thing is that you can create files in your installer scripts, but there will be no record of files created that way. If you make sure they are in the BOM, they can be found and cleaned up later. You can even have the BOM version an empty stub file and then flesh it out with the scripts, just make sure it is in the BOM.
    There is an "lsbom" command line tool you can use to inspect BOM files with.
    The thing is, I edit some PList files which would need to be unedited, not simply deleted. I do not think there is harm in leaving this extra stuff, like launching a program that isn't there (there is a check before the attempt) in a script in /etc. I just do not like leaving junk on people's system.
    I recommend you do not edit files that aren't your own. There is no way to be sure you can successfully un-edit them automatically. Whomever really owns that file could have edited it after your app did. If you then try to edit it again, you could render some part of the system inoperable. If you want to elaborate on this topic, there might be alternatives.
    Like I hate it when you uninstall a game or something on windows, and after it's done in your users directory there is a folder for some game data with 128 megs of junk in it. Actually the other day on my windows box, I noticed a UO Kingdoms folder. I had uninstalled that several months ago. I checked with the add/remove programs and it was not listed. So I looked at the dirs, (it had two of them) and the total was over 200 megs of data. Sure, I have 250 GIGs of space, but still. It just rubs me the wrong way.
    A decent uninstaller should at least ask you if you want to delete these files. Speaking of Windows, look at InnoSetup for an example of what a really good installer builder would look like. It pleases me when multinational corporations are so thoroughly bested by one guy with some freeware. I just wish he would port it the Mac.
    It seems from what you have said, the answer is no, simply because the average mac user probably will not be using a 3rd party uninstaller.
    This is a bit of a speculation, so it may be against the TOS, but the installation architecture could be changing over the next couple of years. Apple no longer recommends the old "drag-n-drop" installers that work so well. They now officially recommend people use the horrible PackageMaker. I think the idea is to improve security using signing certificates and such. I would mind that so much if there was an official uninstaller architecture too. Any time you give some random installer package your admin password, there is no limit (literally) to what that thing could install. Then, if you try to drag the app into the trash, it could easily leave your system completely dead. Things are a mess right now.

  • Brief conclusion of Boss class and there interface concept or basic programming architecture ?

    I am new in this indesign development so i am studying the  documentation provide by sdk till date i think lots of concept are clear to me but still while doing practicle implementation many concept intermixed in my mind .one of them is "command" .so please tell me in brief about it with practical example of creating new document having text frame in indesigen using it .also there are  lots of question in my mind  regarding interface and boss class anyone please share there knowledge regarding them in brief

    Due to a copy/paste glitch, some necessary spaces have inadvertently been removed.  If I could fix this, I would.

  • Is there a way to unbundle IPhoto package contents?

    After migrating to Safari I noticed that my Iphoto library now needs to be opened by right clicking, then "open package contents". I use blogger to upload pictures and when I try to upload pictures; blogger does not give me an option to look through the Iphoto library. I did have some challenges with Iphoto awhile back, so i'm not sure if my Iphoto set-up was redesigned. Anyone have any insight into this?

    There's absolutely no need to do this. Use iPhoto the way it's designed:
    There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 and later*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    (Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and later* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and later:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    All of these are a: faster and b: safer then rooting through the folders inside the package.
    Regards
    TD

  • Deployed Package Execution - Is there a way to execute a package a host has remotely through the client?

    If I have an Program/Package deployed to clients so they can manually run it as needed, is there a way I can remote execute that package on the targeted machine locally (but programattically) instead of having to interface with the SCCM server? 
    Like, through a WMI class or something?  Thanks.

    Well, Roger's client center is open source, so you can always download his code and look at how he's doing it.
    The SDK has a complete section on Software Dist:
    http://msdn.microsoft.com/en-us/library/cc143006.aspx
    Ultimately, everything is done using WMI so initiating WMI functions remotely is quite easy.
    This should get you started also:
    http://wbracken.wordpress.com/2009/10/13/vbscript-run-optional-sccm-advertisements/
    Jason | http://blog.configmgrftw.com

  • Is there something that auto reinstalls old packages from cache?

    You pacman -Syu and something broke - you dont have time to figure out what. All you know is that 20 minutes ago your configuration worked and that you have not pacman -Sc yet. You can figure out later what went wrong, right now you just want a worked system.
    Is there something that already that scans the cache and at least lists the packages that are in the cache that are not installed? So that you can quickly just pacman -S $(them) ???

    one-liners ftw!
    pacman -Q | while read name vers; do LC_ALL=C; find /var/cache/pacman/pkg -name $name* | grep -v $vers | sort -r | head -n1; done
    lists highest version of all installed packages found in your cache not including the installed version.  good luck managing that output
    /edit: the better approach would be to tail /var/log/pacman.log and reverse whatever the -Syu just did using the pacman -U command mentioned before.
    /edit2: at eldragon below: useless use of cat is useless
    Last edited by brisbin33 (2009-07-17 21:13:58)

  • Is there a way to initialize a Graphics object (indirectly)?

    Hi,
    I've a problem with Graphics Abstract class;
    how must I do to initialize a Graphics object?
    I must execute this code:
    Graphics gr;
    gr.drawString("Image",30,0);
    gr.drawString("not",30,30);
    gr.drawString("Found",30,60);
    image.paintIcon(null,gr,0,0);
    the compiler returns my the error:
    "gr not initialized"
    How can I do to initialize this last?
    Thank.

    Infact with
    gr=null;
    i've a null pointer exception;
    but I've also try
    jLabel2.setText("Prova");
    Graphics gr = jLabel2.getGraphics();
    gr.drawString("Image",30,0);
    gr.drawString("not",30,30);
    gr.drawString("Found",30,60);
    image.paintIcon(this,gr,0,0);
    jLabel3.setIcon(image);
    and I've always a null pointer exception.
    Why?
    Thank.

Maybe you are looking for