How to run a function in the oracle plsql object when the object dies

I have an object plsql function member as exec_last.
I want this procedure that is called when the plsql object is cleaned or when the accommodation session this object dies.

In C, we have a system call as atexit(). Is there such a feature in Oracle 10 g or no workaround using embedded java.

This feature is required to empty the contents stored in the plsql in the object to the database, when the program terminates.

Thank you
Best regards,
Navin Srivastava

navsriva wrote:

Is there a better way to cache in memory.

What is the Oracle buffer cache? It is exactly that - a cache for data blocks. The two new blocks (created by inserting new rows) and existing blocks (used by selects, updates and deletions and reused (freespace) inserts).

The Oracle buffer cache is a cache of very mature and sophisticated. Trying to do "+ best +" to the db, buffer cache in another layer of software (such as PL/SQL) is mostly a waste of time and resources... and invariable introduced another layer of s/w which simply increases the number of moving parts. This in turn usually means increased complexity and slow performance.

Why use the treatment in bulk from PL/SQL? The basic answer is to reduce switching between the PL and engine SQL context.

During the execution of a code to insert data in SQL, the data must be passed to the SQL engine, PL PL engine must perform a context to the SQL engine switch so that it can process these data and execute the SQL statement.

If there is a 1000 lines of inserts, this means that a 1000 context switches.

In bulk treatment makes the "+ pipe communication / data + ' between the two biggest ones. Instead of passing data from one line to the SQL engine via a context switch, a collection of in bulk / picture of a 100 lines is passed. There are now only 10 changes of context necessary to push this 1000 lines of the PL engine to the SQL engine.

You can do the same on any other client SQL... (remember, that the PL itself is also a SQL client). You can, using C/C++ for example, do exactly the same thing. When the row data to the SQL engine to insert, pass a collection of 100 rows instead of the data for a single line.

The exact result of the same benefits as in PL/SQL. A pipe communication more, allowing more data to be transferred to and from the SQL, with engine for result less context switching.

Of course, a context switch ito C/C++ is much more expensive than in PL/SQL - as the engine PL is located in the same physical process as the SQL engine. Using C/C++, this will usually be a separate process, to communicate with the SQL engine on the network process.

The same applies to other languages, such as Java, c#, Delphi, Visual Basic, and so on.

It not be wise to introduce another layer of s/w, the motor of PL/SQL and the customer "+ insert +" stored in his memory structures... and then use the PL engine to '+ flower' + for the SQL engine via a process control in bulk.

It will be faster and more scalable, have the language of the client with treatment directly and dealing with the SQL engine directly in bulk.

Simple example. What is SQL * Loader program (written in C), use? It uses no PL as a proxy to move data from a CSV file into a SQL table. He calls SQL directly. It uses a treatment in bulk. It is very fast to load data.

There is an exception to this rule. What PL is used as a layer of processing and validation of business. Instead of the client code, implementation of this logic, it is done using LP. The customer then will not is more manually add an invoice to the table of the INVOICES for example. He called the procedure of PL/SQL AddNewInvoice instead - and this procedure does everything. It checks the valid client code. Ensures that there are stocks of the products ordered on the invoice. Etc.

But in this scenario, PL is not used a flea market "buffer cache. It is used for what it was designed for - a correct application inside the database layer.

Tags: Database

Similar Questions

  • How to remove a function on the main timeline in a clip

    How to remove a function which is coded on an image of the main timeline of a clip?  I tried this, but no dice:

    infoGraphicDisparity.addEventListener (MouseEvent.CLICK, fl_ClickToGoToScene);

    function fl_ClickToGoToScene(event:MouseEvent):void

    {

    parent.removeEventListener (Event.ENTER_FRAME, parent ["enterFrameHandler"]);

    MovieClip (this.root) .gotoAndPlay ("disparity");

    }

    It's the event that I am trying to remove:

    stage.addEventListener (Event.ENTER_FRAME, enterFrameHandler);

    any help would be appreciated as always.

    Thank you!

    any image (which runs after enterFrameHandler is defined) in any display in the display list object

    stage.removeEventListener (Event.ENTER_FRAME, MovieClip (root) .enterFrameHandler);

  • How to run under Linux of the CGF 11 g 10 g (AS)

    I'm the developer of oracle 11g on windows forms.

    My application server is on Linux (10g) platform


    How to run the application server of the CGF 11 g to 10g?

    Published by: Naeem Akhtar, July 13, 2011 10:43

    You cannot run a form 10g with a length of 6i, and you can't run a form 11g with a length of 10g. If you want to run forms 11g, you have to install an application server in 11g.

    see you soon

  • How to do a function with the same argument multiple times and return values in the variables?

    The problem I have is that I have created a function that is really kind of database.  Basically, a bunch of:

    If (a.value == 'number') {}

    b.value = "this expression."

    }

    Inside of the shape are 2 drop-down lists that return numeric values I want to process through this function and the value of return inside separate variables.

    var a = this.getField ("OPE003. EVEN.1.MIP");

    MIP (a);

    var Result1 = Mip();

    I tried to smash * a * to treat the second field

    a = this.getField ("OPE003. EVEN.2.MIP");

    MIP (a);

    var Result2 = Mip();

    Result1 and result2 are placed in an array, joined as a string.

    In doing so, I always get the last treatment twice more than the final result.

    Can I use a function as a batch processor that way?

    You're right, I changed the code to what you said, but how to pass another value by my function so I can get Result1 and Result2?

    is it

    var a = this.getField ("OPE003. EVEN.1.MIP");

    var b = this.getField ("OPE003. EVEN.2.MIP");

    Result1 var = Mip (a);

    var Result2 = Mip (b);

    var c = new Array [performance(1), result2]

  • How to run a script in the idle task

    Hi all

    Successfully, I wrote and performed a routine of idle task that periodically executes a simple method. now, I need to add a feature to this method so that it performs a simple javascript.

    Here is my code:

    ...

    UInt32 myTestIdleTask::RunTask)
    UInt32 appFlags, IdleTimer * timeCheck) {}
    If (appFlags &)
    (IIdleTaskMgr::kMouseTracking
    | IIdleTaskMgr::kUserActive
    | IIdleTaskMgr::kInBackground
    | IIdleTaskMgr::kMenuUp))
    {
    Return kOnFlagChange;
    }

    This-> runTestScript();

    Return kmyTestFvExecInterval;
    }


    void myTestIdleTask::runTestScript() {}

    This is the test script

    PMString myTestScript ("app.activeDocument.exportFile (ExportFormat.pdfType, File(\"/Users/testuser/testing.pdf\"),false);" ');

    I think that I should call CScriptRunner::RunScript()
    somewhere here but without success

    }

    Any help on how to run the Javascript code for myTestScript from the runTestScript() method?

    Thanks in advance,

    Halin

    Already, I solved my problem by using "IExtendScriptUtils".

    For those who are interested, here is my solution:

    void myTestIdleTask::runTestScript() {}

    This is the test script

    PMString myTestScript ("app.activeDocument.exportFile (ExportFormat.pdfType, File(\"/Users/testuser/testing.pdf\"),false);" ');

    PMString engineName ("myengine");

    Int32 errorCode is Utils()-> RunScriptInEngine (engineName, myTestScript);.

    }

    Good luck.

    halin

  • How to create a function for the function date two

    Hai All

    How can we create a function for the date function two and to return the number of hours between two dates

    For example

    1 January 2010 0815' - '01-jan-2010 1715' and I need to calculate the time between two dates

    How can I create a procedure

    Thanks I advance

    Srikkanth.M

    What have you tried?

    Here is an example (untested):

    CREATE OR REPLACE FUNCTION RETURN_HOURS
    (
            pDateStart      IN DATE
    ,       pDateEnd        IN DATE
    )
    RETURN NUMBER
    DETERMINISTIC
    AS
    BEGIN
            RETURN (pDateEnd - pDateStart) * 24;
    END RETURN_HOURS;
    
  • How to run a procedure with the object as OUTPUT parameter

    Hello

    I have a procedure and it composed of 2 parameters, there is an input parameter and it's some ID (NUMBER datatype) and 2nd parameter is an output parameter and it an object type. I want to run this procedure, but not able to do the same thing. Can someone please suggest me how to run a procedure that got the object as output parameter.

    Thank you very much in advance for your support.

    Example:

    SQL> create or replace type t_obj as object (ename varchar2(10), deptno number);
      2  /
    
    Type created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure myproc (p_empno in number, obj out t_obj) is
      2  begin
      3    select t_obj(ename, deptno)
      4    into obj
      5    from emp
      6    where empno = p_empno;
      7* end;
    SQL> /
    
    Procedure created.
    
    SQL> set serverout on
    SQL> declare
      2    v_obj t_obj;
      3  begin
      4    myproc(7788, v_obj);
      5    dbms_output.put_line(v_obj.ename||','||v_obj.deptno);
      6  end;
      7  /
    SCOTT,20
    
    PL/SQL procedure successfully completed.
    
  • How to run a package on the calendar or automatic

    Is it possible to run a package on the calendar?

    For example, all our outgoing pdf to send by post mail must obtain a watermark. Doing so by hand for each lot is a lot of work.

    If I can save files in a particular folder in which Adobe running a lot on the schedule (for example, every 2 minutes), this could save a lot of work.

    Acrobat cannot be automated in this way. You will need to use other

    request to do it, or do it (execute the Action in Acrobat) manually.

  • How to declare a function on the event of change of cursor in AS3?

    Hi all

    I have a function that adds a slider to an expert group;

    I would like this slider to start another function on the event change.

    I'm doing it:

    function() {return A.apply (null, [this] .concat ($A (arguments)))}


    [Bindable]

    public var mySlider: Hslider = new Hslider.

    private function addSlider (): void {}

    mySlider.change = onSliderChanged (event);  / * < = it's my problem * /.

    }

    Any help would be really appreciated.

    Thank you very much.

    You need to add a listener for the change event,

    mySlider.addEventListener (SliderEvent.CHANGE, onSliderChanged);

    private void onSliderChanged(event:SliderEvent):void {}

    ACTION HERE

    }

  • How to run terminal console of the CRIO output rtexe

    Hello

    I want to run the rtexe application in CRIO (9014) from the console output terminal. In my application the availabe lan port is connected to any other device using cross-over cable. That's why I want to change application console using the console terminal. I tried the taskspawn command but the crio restarts. Is there a command so that I can run the terminal console application.

    ... I don't know how to get any input from keyboard (the new path of application) of the console terminal...

    You can use the interface for RS232 communication standard series. If for example you send 1, 2 or 3 as a string to the cRIO and then you change by program the ni - rt.ini to change the path of access between a startup2.rtexe and startup1.rtexe, startup2.rtexe.

    Moreover, I have to restart the controller every time I change the path.

    When you use the method with the executable and then one more, then Yes.

    IAM cannot use the Subvi because I need to change code fpga also to different instances.

    I don't understand why using SubVIs on the RT does not give you the ability to change the fpga code.

    If the second method example would be Sub1.vi, Sub2.vi and Sub3.vi. When you get the 2 interface command series, you close the reference to the FPGA1.vi that is used in Sub1.vi and stop Sub1.vi. Then, you start by program Sub2.vi where you open and run the FPGA2.vi.

    Christian

  • How can I restore function of the basic games.

    Program downloaded UniRegistryRestore, now my basic games will not play.  I use Windows Vista on a 64 bit system

    Hello

    also run the sfc/scannow command.

    http://support.Microsoft.com/kb/929833

    Use the (SFC.exe) System File Checker tool to determine which file is causing the problem and then replace the file. To do this, follow these steps:

    1. Open an elevated command prompt. To do this, click Start, click principally madeprograms,Accessories, right-clickguest, and then clickrun as administrator. If you are prompted for an administrator password or a confirmation, type the password, or clickallow.
    2. Type the following command and press ENTER:
      sfc/scannow

      The sfc/scannow command analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions

    How to analyze the entries in the log file generating the program Checker (SFC.exe) resources of Microsoft Windows in Windows Vista

    http://support.Microsoft.com/kb/928228#appliesTo

    If SFC detects the main problems it can't fix you may need to borrow a Microsoft dvd vista not an acer, HP etc. recovery disk and do a repair installation

    read the below tutorial on how to perform a repair installation

    http://www.Vistax64.com/tutorials/88236-repair-install-Vista.html

  • How to run a script using the OMB tcl

    I'm trying to run a tcl script using the following syntax in cmd

    D:\app\Username\product\11.1.0\db_2\owb\bin\win32 > ombplus.bat c:\t.tcl

    and I get the error

    OMB01001: Not connected to the repository.

    The tcl script was basically accompanied by a tutorial and I can't continue the OWB tutorial, unless I run it first

    Departure ombplus.bat

    You can then start the script with the source command such as

    source C:/t.tcl
    

    Be careful with the backslash (he is not C:\t.tcl)

    You must also add a connection before your script to OWB with the OMBCONNECT

    OMBCONNECT $UserLogin/$UserPassword@$DBHostName:$DBHostPort:$ServiceName USE REPOSITORY '$RepositoryUser' USE MULTIPLE_USER_MODE
    

    Replace the parameters $ with your own value.

    And then your script, you can disconnect:

    OMBDISCONNECT
    

    Success
    Nico

    Documentation is here for the 11g OMBCOMMAND
    http://download.Oracle.com/docs/CD/B28359_01/OWB.111/b31279/TOC.htm

  • How to run this function every 5 seconds?

    I tried using setInterval() but I just can't do things... This is the function I want to run every 5 seconds:

    function next_(event:MouseEvent):void{
         var sliderPos = sliderMC.x;
         if(sliderPos != -696){
              if(sliderPos == 0 || sliderPos == -232 || sliderPos == -464){
                   sliderTween = new Tween(sliderMC,'x',Strong.easeOut,sliderPos,sliderPos-232,10,false);
              }
         }else{
              sliderTween = new Tween(sliderMC,'x',Strong.easeOut,sliderPos,0,15,false);
         }
         
    }
    

    try to change TIMER_COMPLETE just the TIMER, for the type of the event when the listener is added.

    timer.addEventListener(Timer.TIMER, timerNext);
    
  • How to use a function inside the package?

    Hello

    You will need to convert weight unit of kilogram kips when filling out the weight values into a temporary table. In our database, schema there is a function called convert_units is available.
    How could I use this feature in my package? My package is also resides in the same database schema.

    Here, I pasted the function.
         convert_units
       (
         in_base_unit_id       NUMBER,
         in_conversion_unit_id NUMBER,
         in_value              NUMBER
       ) RETURN NUMBER AS
    CURSOR unit_cur IS
      SELECT *
      FROM units_conversion
      WHERE base_unit_id = in_base_unit_id
        AND conversion_unit_id = in_conversion_unit_id;
    unit_rec unit_cur%ROWTYPE;
    BEGIN
      OPEN unit_cur;
      FETCH unit_cur INTO unit_rec;
      IF unit_cur%NOTFOUND THEN
        unit_rec := NULL;
      END IF;
      CLOSE unit_cur;
      RETURN (in_value+unit_rec.pre_adjust_add)*(unit_rec.rate);
    END convert_units;

    Hello

    It seems that the first two arguments of this function are ID in the units_conversion table. If you know this id = 1234 means kilograms, 9876 means kips, then you can do things like:

    wt_kips := convert_units (1234, 9876, wt_kilograms);
    

    or

    INSERT INTO tmp_table ( ..., weight_val,                               ...)
           VALUES           ( ..., convert_units (1234, 9876, wt_kilograms), ...);
    

    I can't just look at the code which could be any valid ID. I'm not even sure of the order of the arguments. I hope you have instructions on how to use the function.

    If the function is in a package named pk_xyz (a different package to the one in which you call it), add the name of the package, like this

    wt_kips := pk_xyz.convert_units (1234, 9876, wt_kilograms);
    
  • How to trace a function on the sphere?

    Hello

    I have a 2D chart and I would like to draw on a sphere as a "thermal conspiracy." The rows and columns of the table are already the elevation and azimuth angles. How to do?

    The image below shows an example of trace of the sphere.

    Thank you

    Frederico Araujo

    Here's the relevant part of my old code. You must change the mapping of an altitude instead of the angle dimension. Should not be difficult.

Maybe you are looking for