Oracle Callback Mechanism

I want to know how many ways Oracles provides Callback mechanism on process level ( e.g. c application ).
currently I know:
(1)Advanced Queuing
(2)Database Change Notification
(3)OCI API callback.
I'm looking for a fast(real-time) callback mechanism (faster than AQ & DCN) and trigging events happen on Stored Procedure level or Table level(not OCI API level).
Is there any?( we are using Oracle 10g, your help is much appreciated)

Oracle is not a real-time database. Nor does Oracle run on any real-time operating systems as far as I know.
And you will need both for real-time processing. A real-time database and a real-time o/s.
Which begs the question - what are you trying to achieve and why? Real-time processing is not typical, especially in the RDBMS environment that by its very nature of concurrency controls, ACID properties and so on, cannot be real-time.

Similar Messages

  • Java callback mechanism

    How do we implement "callback" mechanism in java. ? can any on eexplain me with an example?

    yo_man123 wrote:
    when somethingHappened becomes true?When your code sets it to be true. This event notification idiom is a way for one piece of code to notify another piece of code that something has happened. I think you're over-thinking it. It's quite common for newbs to think there's some magic going on inside the JVM that somehow detects when an event should be raised. There isn't. You do it. You detect when the change has happened, and notify other objects. It'll be easier to explain if you have a concrete need for doing it. If you're just looking at the exercise and hoping it'll stick, you'll hit, well, the problem you've hit - not having an event to relate it to in your head.

  • Trace for a Oracle Callbacks

    Does anyone know how to TRACE the 'sessions' that are performing the callbacks? I need to report the performance statistics and usages involved with using the PL/SQL callback.
    I have tried putting the instance into trace mode (alter system set sql_trace=true) and restarting the instance but I can not find any evidence of my callback procedure being called in the resulting trace files.
    Thanks
    Russell

    Thanks for the responses.
    'Callback' is a term used by Oracle, within the context of AQ, for notification of automatic notification of new messages. For your education, it can either execute a PL/SQL procedure, generate an email or make a HTTP request.
    I am attempting to trace on a v10.2 database, but the process for trace is typically the same across versions (excepting some old versions).
    re Dan: thos sort of reply is not at all helpful, could I suggest if you do not know the subject matter then do not reply. In that way volunteers can save a lot of valuable time
    According to Metalink (Note:305662.1) these processes can be traced by the following method :
    QUOTE>>
    1. For CPU consumption issues sql trace the QMON process in question by doing the following
    Determine the pid of the qmn process (by viewing the OS processes), call it X
    sqlplus "/ as sysdba"
    oradebug setospid X
    oradebug unlimit
    oradebug Event 10046 trace name context forever, level 12
    --Generate trace for 20 minutes
    oradebug Event 10046 trace name context off
    << QUOTE.
    Russell

  • Callback mechanism is not working in Javascript

    JDK versions: Problem occurs in JRE1.4.2 and JRE1.5 (JRE142_05, 5.0 beta), but NOT JRE1.3.1.
    OS: WIndows
    Here is the problem Scenario
    1. A Webpage ( GOM - Javascript ) is running
    2. Clicking on a button in the above webpage will load an applet ( enc3 )
    3. Once we are done with the applet, click on return button to go back to GOM
    4. To return to GOM, function performMiniflowReturnWithMessage in the java file is called which in turn calls "this.getAppletContext().showDocument(new URL(miniFlowClosePage.toString()),"_top");".
    Subsequently function closeMiniflowWindow() is called in the HTML page which in turn calls sendREsultsToGOM.
    Here the call to ""opener."+returnStatusMethodName+"(status, msg, data);";" is throwing a javascript error in Sun plugin.
    Exact text of error message:
    The exact error message is ( JavaScript Error: http://nc3ft3a.ugd.att.com/enc3home/closeminiflowapplet.html??Callback=NC3_alertOnError&Status=-1&Msg=Neither E2EPVC_ODBIDS or ROUTER_ODBID Params was not sent to VPN applet.&, line 44: opener.NC3_alertOnError is not a function )
    Here are our findings :
    1. I could notice that "getAppletContext().showDocument" is one java api that customer is using and this is being called before application encounters problem reported that is the javascript error
    2. showDocument API's functionality is that it requests that the browser or applet viewer show the Web page indicated by the url argument. This API has 2 parameters one is URL and other is the TARGET.
    Target can be any one these
    a. "_self" show in the current frame
    b. "_parent"show in the parent frame
    c. "_top" show in the topmost frame
    d. "_blank" show in a new unnamed top-level windownameshow in a new top-level window named name
    3. In the customer's application, for this API showdocument, URL argument passed is "enc3home/closeminiflowapplet.html?" and _top is passed as Target argument. Hence, the expected behaviour is that topmost frame of this URL that is GOM should be shown instead the above javascript error is thrown. The probable cause could be that instead of getting the link to GOM ( topmost window of enc3 ),  application is getting link to enc3 itself.
    4. Actually this.getAppletContext() as used in the application along with showDocument sun.plugin.viewer.context.NetscapeAppletContext. Therefore NetscapeAppletContext.showDocument is called within the application.
    5. NetscapeAppletContext extends DefaultPluginAppletContext and the showDocument method of this class is called. This function inturn calls doShowDocument. I suspect these functions and this needs to be investigated.
    Also please note that the classes NetscapeAppletContext and DefaultPluginAppletContext are not there in 131 and customer says that problem is not there in 131. Also, the this.getAppletContext will return sun.plugin.navig.win32.AppletPluginContext.
    Application source code is available.

    in this part:
    if(document.LForm.uname.value==null || document.LForm.upassword.value==null)should be:
    if(document.LForm.uname.value=="" || document.LForm.upassword.value=="")or
    if(document.LForm.uname.value.length==0 || document.LForm.upassword.value.length==0)

  • Thread Pool Callback Mechanism

    I am using java.util.concurrent.ExecutorService to create a thread pool. I need a way to inform the user of the progress of the threads in the pool.
    Does anyone have any ideas of how to do this?

    I am using java.util.concurrent.ExecutorService to
    create a thread pool. I need a way to inform the user
    of the progress of the threads in the pool.
    Does anyone have any ideas of how to do this?Hand the Executor instances of SwingWorker, which implements RunnableFuture. SwingWorker also has a progress() method which can provide progress information.

  • Using JNI in Oracle Reports

    Hi.
    I have some difficulties understanding the Oracle Reports mechanism of JNI. The problem I have is the report job is crashed when I use the imported java class.
    I am using Oracle Reports 11.1.2.1 on Oracle Linux
    The scenario of generating report is :
    1. For every page there is a call to imported java class which generates an image (jpg format) as a file
    2. This image file is then appended to the image placeholder in report
    The error stack form engine log is :
    [2014-08-29T18:05:16.699+02:00] [reports] [ERROR] [] [oracle.reports.engine] [tid: 10] [ecid: 0000KWYWsHK5Mel5SvH7ic0006Z6000000,0] [EngineName: rwEng-0] C Engine  Job ID = 41022  ERR java.lang.OutOfMemoryError: Java heap space
    [2014-08-29T18:05:17.537+02:00] [reports] [ERROR] [] [oracle.reports.engine] [tid: 10] [ecid: 0000KWYWsHK5Mel5SvH7ic0006Z6000000,0] [EngineName: rwEng-0] C Engine  Job ID = 41022  ERR REP-1800: A formatter error occurred.
    [2014-08-29T18:05:18.753+02:00] [reports] [ERROR] [] [oracle.reports.engine] [tid: 10] [ecid: 0000KWYWsHK5Mel5SvH7ic0006Z6000000,0] [EngineName: rwEng-0] rwfdt:rwfdtprint  Job ID = 41022  ERR Error occurred sending Job output to cache
    [2014-08-29T18:05:18.822+02:00] [reports] [INCIDENT_ERROR] [REP-1800] [oracle.reports.engine] [tid: 10] [ecid: 0000KWYWsHK5Mel5SvH7ic0006Z6000000,0] [EngineName: rwEng-0] REP-1800 : Java heap space[[
    REP-1800: A formatter error occurred.
    oracle.reports.RWException: IDL:oracle/reports/RWException:1.0
            at oracle.reports.engine.EngineImpl.run(EngineImpl.java:553)
            at oracle.reports.engine.EngineClassPOA._invoke(EngineClassPOA.java:104)
            at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:637)
            at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:189)
            at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1682)
            at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1540)
            at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:922)
            at com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:181)
            at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:694)
            at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:451)
            at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1213)
            at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:471)
            at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:500)
    [2014-08-29T18:05:18.823+02:00] [reports] [NOTIFICATION] [] [oracle.reports.engine] [tid: 10] [ecid: 0000KWYWsHK5Mel5SvH7ic0006Z6000000,0] [EngineName: rwEng-0] EngineImpl:run  oracle.reports.RWException: IDL:oracle/reports/RWException:1.0
    The problem does not occur when I run small report. That is why I suspected I should increase the max heap size. I increased it from defaulted 256M to 2G but the large report still fails to finish. Though the number of pages generated is bigger than with default java heap size. After that I ran the java monitoring tool on application server. As per monitor the heap size is increasing but never reaches max size of 2G. Then I tried to append the same image file to every page (meaning I only called java class once in afterparameterform trigger). In this case the report also finishes successfully.
    So as it seems the the problem is somewhere inside of the report engine mechanism calling java class. I suspect this mechanism is not releasing the memory. Btw the pdf file generated for large report is about 150MB large.
    I would appreciate some insight on reports engine mechanism or the way I would be able to pinpoint the actual cause of the problem.
    Best regards,
    Gregor

    Hi;
    Please see below which could be helpful for your questions:
    How to add custom JAR files to Apache OC4J Classpath in R12 instance? [ID 433241.1]
    How To Sign a Custom Jar File In Oracle EBS 11i With JDK 1.3 And Below [ID 296375.1]
    How to deploy custom JSP and JAR files for iStore? [ID 468181.1]
    Regard
    Helios

  • Oracle SELECT and storage technique

    Hi,
    I have 2 questions please. First of all, what kind of storage mechanism is used in Oracle e.g Oracle 11g, is it HEAP BASED or some other?
    Actually I am not able to search how Oracle stores the data into tables as I've heard that heap based storage is a mechanism in which the data is saved in the same order as it is being inserted?
    What is the Linear Search?
    I've performed test on more than 40 tables with simple SELECT and Elapsed time is always favoring 16k block size when compared to 4k and 8k data block size.
    Just thinking the reason that why SELECT is favoring 16k in all the tests, because the data is saved in hundreds and thousands of data blocks and if it is in the smaller data block, it has to go and search more and more data blocks, is it true?
    Please help me with your expert opinions and if possible please suggest me some book or paper which explains the ORACLE STORAGE MECHANISM AND SEARCHING MECHANISM i.e. LINEAR search or what?
    I'll appreciate the suggestions.
    Thanks a lot.
    Best Regards,
    John

    John-M wrote:
    I see you've also re-opened an older question which overlaps with this topic - so I'll be making some comments there as well: Re: single col v/s multi col table elapsed time comparison
    I have 2 questions please. First of all, what kind of storage mechanism is used in Oracle e.g Oracle 11g, is it HEAP BASED or some other?
    The most commonly used mechanism is heap-based - rows are put wherever the next convenient space happens to be.
    Actually I am not able to search how Oracle stores the data into tables as I've heard that heap based storage is a mechanism in which the data is saved in the same order as it is being inserted?
    Not quite - but see other post.
    What is the Linear Search? Depends how technical you want to be - the implication is that you "start at the beginning, work through to the end and then stop". The search it linear because the time it takes to complete it proportional with the volume of data available.
    >
    Please help me with your expert opinions and if possible please suggest me some book or paper which explains the ORACLE STORAGE MECHANISM AND SEARCHING MECHANISM i.e. LINEAR search or what?
    The Concepts manual is pretty good on storage.
    Regards
    Jonathan Lewis

  • Oracle Statistics - Best Practice?

    We run stats with brconnect weekly:
    brconnect -u / -c -f stats -t all
    I'm trying to understand how some of our stats are old or stale.  Where's my gap?  We are running Oracle 11g and have Table Monitoring set on every table.  My user_tab_modifications is tracking changes in just over 3,000 tables.  I believe that when those entries surpass 50% changed, then they will be flagged for the above brconnect to update their stats.  Correct?
    Plus, we have our DBSTATC entries.  A lot of those entries were last analyzed some 10 years ago.  Does the above brconnect consider DBSTATC at all?  Or do we need to regularly run the following, as well?
    brconnect -u / -c -f stats -t dbstatc_tab
    I've got tables that are flagged as stale, so something doesn't seem to be quite right in our best practice.
    SQL> select count(*) from dba_tab_statistics
      2  where owner = 'SAPR3' and stale_stats = 'YES';
      COUNT(*)
          1681
    I realize that stats last analyzed some ten years ago does not necessarily mean they are no longer good but I am curious if the weekly stats collection we are doing is sufficient.  Any best practices for me to consider?  Is there some kind of onetime scan I should do to check the health of all stats?

    Hi Richard,
    > We are running Oracle 11g and have Table Monitoring set on every table.
    Table monitoring attribute is not necessary anymore or better said it is deprecated due to the fact that these metrics are controlled by STATISTICS_LEVEL nowadays. Table monitoring attribute is valid for Oracle versions lower than 10g.
    > I believe that when those entries surpass 50% changed, then they will be flagged for the above brconnect to update their stats.  Correct?
    Correct, if BR*Tools parameter stats_change_threshold is set to its default. Brconnect reads the modifications (number of inserts, deletes and updates) from DBA_TAB_MODIFICATIONS and compares the sum of these changes to the total number of rows. It gathers statistics, if the amount of changes is larger than stats_change_threshold.
    > Does the above brconnect consider DBSTATC at all?
    Yes, it does.
    > I've got tables that are flagged as stale, so something doesn't seem to be quite right in our best practice.
    The column STALE_STATS in view DBA_TAB_STATISTICS is calculated differently. This flag is used by the Oracle standard DBMS_STATS implementation which is not considered by SAP - for more details check the Oracle documentation "13.3.1.5 Determining Stale Statistics".
    The GATHER_DATABASE_STATS or GATHER_SCHEMA_STATS procedures gather new statistics for tables with stale statistics when the OPTIONS parameter is set to GATHER STALE or GATHER AUTO. If a monitored table has been modified more than 10%, then these statistics are considered stale and gathered again.
    STALE_PERCENT - Determines the percentage of rows in a table that have to change before the statistics on that table are deemed stale and should be regathered. The valid domain for stale_percent is non-negative numbers.The default value is 10%. Note that if you set stale_percent to zero the AUTO STATS gathering job will gather statistics for this table every time a row in the table is modified.
    SAP has its own automatism (like described with brconnect and stats_change_threshold) to identify stale statistics and how to collect statistics (percentage, histograms, etc.) and does not use / rely on the corresponding Oracle default mechanism.
    > Any best practices for me to consider?  Is there some kind of onetime scan I should do to check the health of all stats?
    No performance issue? No additional and unnecessary load on the system (e.g. dynamic sampling)? No brconnect runtime issue? Then you don't need to think about the brconnect implementation or special settings. Sometimes you need to tweak it (e.g. histograms, sample sizes, etc.), but then you have some specific issue that needs to be solved.
    Regards
    Stefan

  • Oracle troubles with multiple schemas in same database

    We have several different users set up with individual schemas in the
    same Oracle database. We run into trouble when more than one user tries
    to use Kodo in their local schema. Things go fine for User A, but when
    the User B tries to run the schematool on their own Oracle schema, they
    get this nonsense:
    javax.jdo.JDOFatalDataStoreException: An error occurred while connecting
    to the data store.
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=SELECT
    DISTINCT JDO_SCHEMA_METADATAX.CLASSNAMEX FROM JDO_SCHEMA_METADATAX]
    ORA-00942: table or view does not exist
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.<init>(SchemaTool.java:99)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1114)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1083)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1073)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1064)
    If the User A drops all the tables from their schema, then things go
    fine for User B ... but then User A will have the same problem when they
    try to run the schematool.
    It is our suspicion that Kodo is actually selecting the metadata all of
    the tables in **everybody's** schemas, and thus erroneously thinking
    that jdo_schema_medatax already exists. It really ought to restrict
    itself to the schema it's actually connected to.
    If our theory is correct, it would explain why Kodo is so incredibly,
    horribly, painfully slow to connect to our Oracle database -- we have
    dozens of schemas in there, many of which have hundreds of tables.
    Is 2.3.0 addressing this problem?
    Paul

    Paul,
    Are you using the 'schema-name' system preference setting for each user?
    Oracle's mechanism for selecting database metadata requires that the
    appropriate schema name be explicitly when more than one schemas are used.
    See the database setup section of our documentation for more information.
    -Patrick
    On 7/3/02 3:50 PM, "Paul Cantrell" <[email protected]> wrote:
    We have several different users set up with individual schemas in the
    same Oracle database. We run into trouble when more than one user tries
    to use Kodo in their local schema. Things go fine for User A, but when
    the User B tries to run the schematool on their own Oracle schema, they
    get this nonsense:
    javax.jdo.JDOFatalDataStoreException: An error occurred while connecting
    to the data store.
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=SELECT
    DISTINCT JDO_SCHEMA_METADATAX.CLASSNAMEX FROM JDO_SCHEMA_METADATAX]
    ORA-00942: table or view does not exist
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.<init>(SchemaTool.java:99)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1114)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1083)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1073)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1064)
    If the User A drops all the tables from their schema, then things go
    fine for User B ... but then User A will have the same problem when they
    try to run the schematool.
    It is our suspicion that Kodo is actually selecting the metadata all of
    the tables in **everybody's** schemas, and thus erroneously thinking
    that jdo_schema_medatax already exists. It really ought to restrict
    itself to the schema it's actually connected to.
    If our theory is correct, it would explain why Kodo is so incredibly,
    horribly, painfully slow to connect to our Oracle database -- we have
    dozens of schemas in there, many of which have hundreds of tables.
    Is 2.3.0 addressing this problem?
    Paul
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • RMI Callbacks with Highavailability

    Hi,
    I would like to use the RMI Callbacks mechanism. The only problem I got is that I need to also implement highavailability, meaning that I will have more than one server. How can this be implement? Do I need to pass the callback reference to all the other servers? Is it possible to keep the reference in a data base?
    Thanks!

    I resent your remark.
    A client can connect to one server. Now, this server has the refernce to later be used by RMI Callback. In order for other servers to use it as well, the server can serialize the reference and save it in the DB (that was my question - if saving it in the database is possible). A server that gets a request from a client and wants to forward it to another client, checks to see if it has its reference. If not, it reads it from the database and uses it.

  • What is Connection in Oracle 10g Database?

    Please let me know what is connection term in Oracle 10g Database in detail?
    Thanks,
    Waheed.

    Network Connections
    Oracle Net Services is Oracle’s mechanism for interfacing with the communication
    protocols used by the networks that facilitate distributed processing and distributed
    databases.
    Connections and Sessions
    Connection and session are closely related to user process but are very different in
    meaning.
    A connection is a communication pathway between a user process and an Oracle
    instance. A communication pathway is established using available interprocess
    communication mechanisms (on a computer that runs both the user process and
    Oracle) or network software (when different computers run the database
    application and Oracle, and communicate through a network).
    Oracle® Database
    Concepts
    10g Release 1 (10.1)
    Part No. B10743-01

  • "DEADLOCK" when showing dialog from RMI-callback.

    Hi!
    Today is the 10th day (full time) that I've been searching for a solution in Java Forums and Internet, but I couldn't find anything that helps me. Help is extremely appreciated, otherwise I'll go crazy! :-)
    The problem is that RMI-callback thread "somehow blocks" the Event Dispatch Thread.
    I want to do following:
    1) I push the button in the client (btDoSomething)
    (MOUSE_RELEASED,(39,14),button=1,modifiers=Button1,clickCount=1 is automatically pushed onto EventQueue)
    2) btDoSomethingActionPerformed is invoked
    3) inside of it I make a call to RMI-server (server.doSomething())
    4) from this server method I invoke RMI-callback back to the client (client.askUser())
    5) in the callback I want to display a question to the user (JOptionPane.showConfirmDialog)
    6) user should answers the question
    7) callback returns to server
    8) client call to the server returns
    9) btDoSomethingActionPerformed returns and everybody is happy :-)
    This works normally in normal Client, that means, while a button is pushed, you can show Dialogs, but with RMI callback I get problems.
    I just made a small client-server sample to simulate real project. What I want to achieve is that client invokes server method, server method does something, but if server method doesn't have enough information to make the decision it needs to do call back to the client and wait for input, so the user gets an JOptionPane.
    Here is my callback method:
        /** this is the remote callback method, which is invoked from the sevrer */
        public synchronized String askUser() throws java.rmi.RemoteException {
            System.out.println("askUser() thread group: " + Thread.currentThread().getThreadGroup());
            System.out.println("callback started...");
            try {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        System.out.println("My event started...");
                        JOptionPane.showConfirmDialog(parentFrame, "Are you OK?", "Question", JOptionPane.YES_NO_OPTION);
                        System.out.println("My event finished.");
            }catch (Exception e) {
                e.printStackTrace();
            try {
                Thread.currentThread().sleep(10000);
            }catch (Exception e) {
                e.printStackTrace();
            System.out.println("callback finished.");
            return "Yo!"; // just return anything
        }Here in this sample I let the callback thread sleep for 10 seconds, but in real project I let it sleep infinitely and I want to wake it up after the user has answered JOptionPane. But I have the DEADLOCK, because event queue is waiting for callback to finish and doesn't schedule the "showing dialog" event which contains the command for waking up the callback thread.
    I looked very precisely when the event queue starts again to process events: it is precisely then when btDoSomethingActionPerformed is finished.
    When I'm not accessing GUI inside of the callback, this callback mechanism works perfectly, but as soon as I want to show the dialog from inside of the RMI-callback method, the "AWT Event Dispatch Queue" is somehow frozen until RMI-callback thread is finished (and in turn btDoSomethingActionPerformed terminates) . I cannot explain this weird behaviour!!!
    If I don't use SwingUtilities.invokeLater (I know this shoudn't be done outside of Event Dispatch Thread), but access the GUI directy, my JOptionPane is shown, but is not painted (it is blank gray) until callback thread returns.
    Why showing (or painting) of dialog is not done until btDoSomethingActionPerformed is finished?
    I also tried to spawn a new Thread inside of main RMI-callback thread, but nothing changed.
    I also tried the workaround from some older posting to use myInvokeLater:
        private final static ThreadGroup _applicationThreadGroup = Thread.currentThread().getThreadGroup();
        public void myInvokeLater(final Runnable code) {
            (new Thread(_applicationThreadGroup, new Runnable() {
                public void run() { SwingUtilities.invokeLater(code); }
            ).start();
        }but this didn't help either.
    Then I tried to spawn a new Thread directly from the Client's constructor, so that I'm sure that it belongs to the main appplication thread group. I even started that thread there in the constructor and made it wait for the callback. When callback came in, it would wake up that sleeping thread which should then show the dialog. But this did't help either.
    Now I think that it is IMPOSSIBLE to solve this problem this way.
    Spawning a new Process could work I think, but I'm not really sure if I want do to that.
    I know I could make a solution where server method is invoked and if some information is missing I can raise custom exception, provide the input on client side and call the same server mathod again with this additional data, but for that I need to change server RMI interfaces, etc... to fit in this concept. I thought callback would much easier, but after almost 10 days of trying the callback...I almost regreted it :-(
    Is anyone able to help?
    Thank you very much!
    Please scroll down for the complete sample (with build and run batch files), in case someone wants to try it. Or for the time being for your convenience you can download the whole sample from
    http://www.onlineloop.com/~tornado/download/rmi_callback_blocks_gui.zip
    ######### BEGIN CODE ####################################
    package callbackdialog;
    public interface ICallback extends java.rmi.Remote {
        public String askUser() throws java.rmi.RemoteException;
    package callbackdialog;
    public interface IServer extends java.rmi.Remote {
        public void doSomething() throws java.rmi.RemoteException;
    package callbackdialog;
    import java.rmi.Naming;
    public class Server {
        public Server() {
            try {
                IServer s = new ServerImpl();
                Naming.rebind("rmi://localhost:1099/ServerService", s);
            } catch (Exception e) {
                System.out.println("Trouble: " + e);
        public static void main(String args[]) {
            new Server();
    package callbackdialog;
    import java.rmi.Naming;
    public class ServerImpl extends java.rmi.server.UnicastRemoteObject implements IServer {
        // Implementations must have an explicit constructor
        // in order to declare the RemoteException exception
        public ServerImpl() throws java.rmi.RemoteException {
            super();
        public void doSomething() throws java.rmi.RemoteException {
            System.out.println("doSomething started...");
            try {
                // ask the client for the "missing" value via RMI callback
                ICallback client = (ICallback)Naming.lookup("rmi://localhost/ICallback");
                String clientValue = client.askUser();
                System.out.println("Got value from callback: " + clientValue);
            }catch (Exception e) {
                e.printStackTrace();
            System.out.println("doSomething finished.");
    package callbackdialog;
    import java.rmi.server.RemoteStub;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.registry.Registry;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.Naming;
    import javax.swing.JOptionPane;
    import javax.swing.SwingUtilities;
    import javax.swing.JFrame;
    public class Client extends javax.swing.JFrame implements ICallback {
        private final JFrame parentFrame = this;
        private Registry mRegistry = null;
        private RemoteStub remoteStub = null;
        private IServer server = null;
        private final static ThreadGroup _applicationThreadGroup = Thread.currentThread().getThreadGroup();
        /** Creates new form Client */
        public Client() {
            initComponents();
            System.out.println("Client constructor thread group: " + Thread.currentThread().getThreadGroup());
            try {
                server = (IServer)Naming.lookup("rmi://localhost/ServerService");
                // register client to the registry, so the server can invoke callback on it
                mRegistry = LocateRegistry.getRegistry("localhost", 1099);
                remoteStub = (RemoteStub)UnicastRemoteObject.exportObject((ICallback)this);
                Registry mRegistry = LocateRegistry.getRegistry("localhost", 1099);
                mRegistry.bind("ICallback", remoteStub);
            }catch (java.rmi.AlreadyBoundException e) {
                try {
                    mRegistry.unbind("ICallback");
                    mRegistry.bind("ICallback", remoteStub);
                }catch (Exception ex) {
                    // ignore it
            }catch (Exception e) {
                e.printStackTrace();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            java.awt.GridBagConstraints gridBagConstraints;
            secondTestPanel = new javax.swing.JPanel();
            btDoSomething = new javax.swing.JButton();
            getContentPane().setLayout(new java.awt.GridBagLayout());
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("RMI-Callback-GUI-problem sample");
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    formWindowClosing(evt);
            secondTestPanel.setLayout(new java.awt.GridBagLayout());
            btDoSomething.setText("show dialog");
            btDoSomething.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    btDoSomethingActionPerformed(evt);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 3;
            gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0);
            secondTestPanel.add(btDoSomething, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
            gridBagConstraints.weightx = 1.0;
            gridBagConstraints.weighty = 1.0;
            getContentPane().add(secondTestPanel, gridBagConstraints);
            pack();
        private void btDoSomethingActionPerformed(java.awt.event.ActionEvent evt) {                                             
            System.out.println(java.awt.EventQueue.getCurrentEvent().paramString());
            try {
                server.doSomething(); // invoke server RMI method, which will do the client RMI-Callback
                                      // in order to show the dialog
            }catch (Exception e) {
                e.printStackTrace();
        private void formWindowClosing(java.awt.event.WindowEvent evt) {                                  
            try {
                mRegistry.unbind("ICallback");
            }catch (Exception e) {
                e.printStackTrace();
            setVisible(false);
            dispose();
            System.exit(0);
        /** this is the remote callback method, which is invoked from the sevrer */
        public synchronized String askUser() throws java.rmi.RemoteException {
            System.out.println("askUser() thread group: " + Thread.currentThread().getThreadGroup());
            System.out.println("callback started...");
            try {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        System.out.println("My event started...");
                        JOptionPane.showConfirmDialog(parentFrame, "Are you OK?", "Question", JOptionPane.YES_NO_OPTION);
                        System.out.println("My event finished.");
            }catch (Exception e) {
                e.printStackTrace();
            try {
                Thread.currentThread().sleep(10000);
            }catch (Exception e) {
                e.printStackTrace();
            System.out.println("callback finished.");
            return "Yo!"; // just return anything
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    Client client = new Client();
                    client.setSize(500,300);
                    client.setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton btDoSomething;
        private javax.swing.JPanel secondTestPanel;
        // End of variables declaration
    1_build.bat
    javac -cp . -d . *.java
    rmic callbackdialog.ServerImpl
    rmic callbackdialog.Client
    pause
    2_RunRmiRegistry.bat
    rmiregistry
    pause
    3_RunServer.bat
    rem java -classpath .\ Server
    java callbackdialog.Server
    pause
    4_RunClient.bat
    java callbackdialog.Client
    pause
    ######### END CODE ####################################

    I can understand that only partially, because SwingUtilities.invokeLater puts(redirects) my runnable object directly into AWT thread. The only conclusion I can draw from all things that I have tried until now , is that SwingUtilities.invokeLater(<showing the dialog>) invoked from a RMI thread somehow have lower "priority" than events coming directly from the AWT-thread and therefore it is held back until normal awt event completes (in this case BUTTON_RELEASED).
    But what I don't understand is the fact that the dialog is not shown even If I create and start a new thread from the client's constructor. This thread has nothing to do with RMI as it is in the main thread group:
        private BlockingObject dialogBlocker = new BlockingObject();
        private BlockingObject blocker = new BlockingObject();
        public Client() {
            initComponents();
            (new Thread() {
                public void run() {
                    try {
                        dialogBlocker.sleep(0);
                        System.out.println("My event started...");
                        JOptionPane.showConfirmDialog(parentFrame, "Are you OK?", "Question", JOptionPane.YES_NO_OPTION);
                        blocker.wake();
                        System.out.println("My event finished.");
                    }catch (Exception e) {
                        e.printStackTrace();
            }).start();
            ...Callback is then only used to wake up this thread which should display the dialog:
        public Object askUser() throws java.rmi.RemoteException {
            System.out.println("callback started...");
            dialogBlocker.wake();
            blocker.sleep(0);
            System.out.println("callback finished.");
            return userChoice; // return anything I don't care for now
    class BlockingObject {
        public void sleep(long timeout) {
            synchronized(this){
                try {
                    wait(timeout);
                }catch (InterruptedException e) {}
        public void wake() {
            synchronized(this){
                notifyAll();
        }In this case the dialog is shown, but it is NOT painted, so I have deadlock again. Why it is not painted?!?
    Haven't I uncouple it from RMI-Thread?
    But perhaps I'm looking at the wrong side of the whole thing.
    If I invoke server.doSomething (as ejp proposed) in a separate thread, then everything is fine (except that I cannot use this solution in my project :-( ).
    It seems that the whole problem is NOT AT ALL related to callback itself, but rather to the fact that if client invokes remote call, even dialogs can't be shown until the rmi call returns to the client.
    Thank you, Drindilica

  • Async webservice with Callback

    Hi Experts,
    How to call a Asynchronous Microsoft webservice(Used callback mechanism) from XI?
    First I have to call the Microsoft webservice, it will return acknowledgement about the status. Again I have to invoke the webservice then it(microsoft) will return the response.
    How to do the above steps using XI? Please share your suggestions
    Regards
    Sara

    Hi Sara,
    Major thing is if ur  webservice accepts some data and gives some response, then both input and output should get imported into XI as seperate message types (Under Messages Tab) as shown in step 1 of ur referred weblog
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    So there u must have 2 messages: 1 for request and 1 for response. This depends upon ur wsdl structure. Once u get these messages, u could proceed with ur message mapping
    Steps are,
    1.import the wsdl file in Integration Repository in Integration Objects->external definitions.
    2.then create message types using the imported WSDL request and response.
    3.Other things are as usual.
    using SAP XI we can easily connect to webservices pls chk the links
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00c36ef6-dab9-2910-6ca9-a96b820de582
    /people/yomeshp.sharma/blog/2006/05/31/integrating-jdedwards-system-with-xi-using-iway-adapter-part--iii
    /people/anton.wenzelhuemer/blog/2006/03/05/integrating-php-and-abap-using-webservices
    /people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap
    http://help.sap.com/saphelp_nwpi71/helpdata/en/11/e8179b247e4720882512a04041491d/frameset.htm
    Regards,
    Vinod.

  • When do we use Oracle LDAP ?

    Version: 11.2.0.3 on RHEL 5.8
    I have used tnsnames.ora file and easyConnect to connect to the DB.
    Recently , I came across Oracle LDAP which uses $ORACLE_HOME/network/admin/ldap.ora .
    What kind of applications use Oracle LDAP to connect to a DB ?
    Why do we even need Oracle LDAP mechanism when we had tnsnames.ora file for DB Name resolving ?

    Hi Ken,
    Generally it's used for 'large' sites where there are a large number of databases and a large number of clients. Rather than everyone having a copy of the tnsnames files that is somehow kept up to date on lots of servers and clients you can store the tnsnames entries in ldap (OID or microsoft AD). Then it's stored in one central place that everyone queries, a change then is made centrally and picked up by everyone immediately - making a large estate much easier to manage.
    It is also needed for 'enterprise user security' (again using oid) - here users are stored in a central directory and referenced from each database in the estate. You change the password for you username in the directory and that password is then 'updated' for every database (without having to go an alter user on every single system - each database looks in oid to validate the username and work out what rights it should have) - it's very powerful stuff for large estates and makes things much easier to manage.
    For small systems though it will probably never be required.
    Cheers,
    Harry
    http://dbaharrison.blogspot.com

  • JCO Callbacks

    Is it possible using JD and OAS 4.0 to do callbacks from the JCO.
    If it is please would you give a simple example e.g.
    client registers with JCO. Then JCO calls a sendmessage("hello")
    method call to the client.
    Apologies if this is not the correct group, Please point me in
    the right Direction.
    Thanks
    Dave
    null

    mark tomlinson (guest) wrote:
    : This was brought up internally a bit earlier, here is what the
    : response was from the OAS group:
    : "At the moment we do not provide a notification mechanism.
    : Clients are defined to act in a request response kind of
    manner.
    : Looking into the future and the move to EJB, there is no
    : callback mechanism there either, at least not in the tipical
    : CORBA way. The proposal there is to use JMS (messaging) as the
    : way to deal with notifications.
    : So I do not think that callbacks will be in the picture any
    time
    : soon. The only posibility is to do polling in order to check if
    : the notification has arrived."
    Please correct me if I'm wrong but I thought you in CORBA had
    both synchronoys and asynchronous method invocation (with
    callback of notification)?
    null

Maybe you are looking for

  • In Scope missing in Transaction tab

    Hi All, My company has recently started to work with Solution manager. We have created a template project in solution manager that contains all our processes. I'm now tasked by testing the testing functionality of solution manager. By reading and doi

  • HR Report for finding details for the new hires and leavers

    Dear All, I am very new to SAP HR ABAP. Need Help I have to create a report which fetches all the details <Details are mentioned below> for all the 1)     New hires 2)     Leavers in between a time range. <Details to be fetched :~  Title Fax Mobile N

  • Deleting wikis with missing About pages in Lion server.

    I am new mac mini lion server owner.  Somehow I ended up with Wikis without  About Pages n Wiki server and am unable to delete those wikis even with my admin account.  When I go to those wikis I get a message "An unexpected error occurred.".  I see A

  • How to retrieve deleted camera roll on ipad

    Can anyone help? I have deleted the camera roll photos from the ipad by mistake. I plugged the ipad into my computer and treated it as a camera device and selected copy all pitcures. I could not backup to the icloud because the files were too big. I

  • What does "Adjustments disabled" mean and how do I get it enabled?

    When 2.1 came out I bought it, but have only tried to use it today. Projects works, Metadata works but Adjustments says "Quick Preview On (adjustments disabled). I have a couple of questions? 1) How did this happen? 2) What does it mean and? 3) How c