Need to avoid exception w.r.t database when caching disabled, skip database

I have a situation here.
Want to bypass database connection if caching disabled. If caching found enable, only then try to establish a database connection.
One part of application should work when database is down as it doesn't require connection to database at all.
While other parts should throw exception when database connection not available.
the piece of code looks like this:
public byte[] getStagedSchedule(long begin, int channelID, String stage, String username, String password, Number releaseID, Number planningTypeId ) throws SchedExExportException, SecurityServiceException
byte[] ret = null;
try
Date myDate = new Date(begin);
this.stageConfig = new StageConfig(stage, new Integer(channelID), myDate);
if(!this.stageConfig.isCached())
IService service = null; //database connection not required here (can handle that part)
StageAccessService myStage = new StageAccessService(service, myDate, new Integer(channelID), stage,username, releaseID, planningTypeId);
try{
ret = myStage.getXML();
catch(SchedExExportException e){
LogUtils.getExtLogger().error("PSIStopProcessException: " + e.getMessage(), null, null, e);
throw new SchedExExportException(e);
else{
IService service = ServiceFactory.getInstance("TxSchedEx"); //database connection string
StageAccessService myStage = new StageAccessService(service, myDate, new Integer(channelID), stage,username, releaseID, planningTypeId);
ret = myStage.getXML();
if(service != null)
service.release();
catch (ServiceException e)
LogUtils.getExtLogger().error("ServiceException: " + e.getMessage(), null, null, e);
throw new SchedExExportException(e);
return ret;
Now this code is working as per my requirement. for the time being.
But have two major problems to be solved here.
1) this piece of code :
this.stageConfig = new StageConfig(stage, new Integer(channelID), myDate);
is getting called in other class as well. i.e. inside this:
StageAccessService myStage = new StageAccessService(service, myDate, new Integer(channelID), stage,username, releaseID, planningTypeId);
have initialise method. which internally calls this method:
private boolean initialize(IService service, Date date, Number channel, String stage, Number releaseId, Number planningTypeId) throws PSIStopProcessException
boolean ret = false;
if ( ( null != service ) && ( null != date ) && ( null != channel)&& ( null != stage))
this.service = service;
this.scheduleDate = date;
this.scheduleChannel = channel;
this.stageConfig = new StageConfig(stage, channel, date);
this.planningTypeId = planningTypeId;
this.givenReleaseId = releaseId;
ret = true;
initRelease(releaseId);
else if ( ( null == service ) && ( null != date ) && ( null != channel)&& ( null != stage)) // just to handle if database connection not available.
this.scheduleDate = date;
this.scheduleChannel = channel;
this.stageConfig = new StageConfig(stage, channel, date);
this.planningTypeId = planningTypeId;
this.givenReleaseId = releaseId;
ret = true;
return ret;
Because StageAccessService is the real entry point for all other classes to access information about stage (staging). (So making StageConfig singleton, won't help me)
Now is there any way i can avoid :
this.stageConfig = new StageConfig(stage, channel, date);
getting called twice in my code.
why this is required is this method checks for caching real values.
public byte[] getXML() throws SchedExExportException
byte[] ret = null;
if ( !this.stageConfig.isCached() )
ret = dynamicLoadXML();
else
ret = loadReleaseFromStage();
if (ret == null && this.stageConfig.isLazyLoading())
ret = dynamicLoadXML();
saveScheduleInStage(ret);
and so on.............
try{
if (this.stageConfig.isTransformSchedules() && ret != null)
etc
2) Other workaround can be like: check if database connection is there or not. log the exception in catch block. but don't throw back.
So that the part which doesn't require database connection can work. But if request is not calling that part, then better throw exception also.
I don't know whihc approcah is good in this case.
Can anyone suggest anything better then this.
thanks.

I'm afraid that you need to provide further info about your two databases like versions, whether they have the replication option installed etc.
Generally speaking you have two methods available:
1. Use the replication options (needs setup like repadmins, master sites, snapshots etc)
2. Script it yourself (ie rewrite the replicator :-) trough DBlinks, stored procedures etc.
I would reccommend option 1 since you do not need to re-invent the wheel.
null

Similar Messages

  • Need to pass information from MS access database to another prog

    Hi,
    I really need some help here...
    I need to pass selected information from my database to another information.
    I am able to select and display the infotmation but i am not sure how i can transfer the information to the next program. Can any one please offer me some assistance?
    My code is as follow:
    /* Getting data from PSM32 and displaying it *can work* */
    import java.net.URL;
    import java.sql.*;
    import java.lang.String;
    /** Application to create a Ganttchart * */
    public class PSMdb
    public static void main (String argv[])
    //SQLQueryFormat a = new SQLQueryFormat();
    System.out.println("\nEstablishing Connection - Pls Wait... \n");
    /** Get Info fr database**/
    try
         //Connect to the database specified in the URL
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con = DriverManager.getConnection("jdbc:odbc:PSM32");
         System.out.println("Connection Established.\n");
         //Create a SELECT statement object
         Statement statmt = con.createStatement();
         //Issue the SELECT statement
         String querySt = "SELECT Set, Name, Order " +
         "FROM PMETERS " +
         "WHERE Set = 'BRAKE.BAK' ";
         //Create and execute query
         ResultSet res = statmt.executeQuery(querySt);
           while (res.next())
                String Proj = res.getString(1); //get Proj Name
              String Task = res.getString(2); //get Task Name
              //Print statement
              System.out.println("" +Proj);
              System.out.println("" +Task);
           //Close Statement and Connection
         statmt.close();
         con.close();
         System.out.println("\nConnection Closed - Operation Successful.");
         catch(Exception E)
    //Print out the Exception Error
    System.out.println("Error:" +E );
    }And yes there is another problem. I can compile and run the program in a C:\folder but when i open the document in a project workspace, i cant compile the above code. Can any one please offer me assistance?
    Thanks a million.

    To NanookOITheNorth:
    Could you provide some more relevent information
    about what the other program is and how data should
    be transferred to it? API? Socket? File?was wanted to use the "return task" thing. Issit possible to use that?
    To annie79:
    my next program is supposed to retrive the events in the "task" field and display it in a applet. After retriving the tasks i will be getting the dates to produce the gantt chart. uses the jfree lib functions.
    the code for the applet is as follow
    /* original gantt chart program that can work*/
    import java.applet.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.Calendar;
    import java.util.Date;
    import org.jfree.chart.ChartFactory;
    import org.jfree.chart.ChartPanel;
    import org.jfree.chart.JFreeChart;
    import org.jfree.data.category.IntervalCategoryDataset;
    import org.jfree.data.gantt.Task;
    import org.jfree.data.gantt.TaskSeries;
    import org.jfree.data.gantt.TaskSeriesCollection;
    import org.jfree.data.time.SimpleTimePeriod;
    /** Application to create a Ganttchart * */
    public class Ganttchart extends JApplet{
    /** @param title , frame title **/
        public void init() {
            final IntervalCategoryDataset dataset = createDataset();
            final JFreeChart chart = createChart(dataset);
            // add the chart to a panel...
            final ChartPanel chartPanel = new ChartPanel(chart);
            // this size (500, 270) here doesn't matter cos this become the html control
            // how big u wan can change in the html code the width="800" height="600"
            chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
            setContentPane(chartPanel);
         * Creates a sample dataset for a Ganttchart.
         * @return The dataset.
        public static IntervalCategoryDataset createDataset() {
         //"Task" information should be retrived from the database to replace this current 1
            /*final TaskSeries s1 = new TaskSeries("Scheduled");
            s1.add(new Task("Write Proposal",
                   new SimpleTimePeriod(date(1, Calendar.APRIL, 2001),
                                        date(5, Calendar.APRIL, 2001))));
            s1.add(new Task("Obtain Approval",
                   new SimpleTimePeriod(date(9, Calendar.APRIL, 2001),
                                        date(9, Calendar.APRIL, 2001))));
            s1.add(new Task("Requirements Analysis",
                   new SimpleTimePeriod(date(10, Calendar.APRIL, 2001),
                                        date(5, Calendar.MAY, 2001))));
            final TaskSeries s2 = new TaskSeries("Actual");
            s2.add(new Task("Write Proposal",
                   new SimpleTimePeriod(date(1, Calendar.APRIL, 2001),
                                        date(5, Calendar.APRIL, 2001))));
            s2.add(new Task("Obtain Approval",
                   new SimpleTimePeriod(date(9, Calendar.APRIL, 2001),
                                        date(9, Calendar.APRIL, 2001))));
            s2.add(new Task("Requirements Analysis",
                   new SimpleTimePeriod(date(10, Calendar.APRIL, 2001),
                                        date(15, Calendar.MAY, 2001))));*/
            final TaskSeriesCollection collection = new TaskSeriesCollection();
            collection.add(s1);
            collection.add(s2);
            return collection;
         * Utility method for creating <code>Date</code> objects.
         * @param day  the date.
         * @param month  the month.
         * @param year  the year.
         * @return a date.
        private static Date date(final int day, final int month, final int year) {
            final Calendar calendar = Calendar.getInstance();
            calendar.set(year, month, day);
            final Date result = calendar.getTime();
            return result;
         * Creates a chart.
         * @param dataset  the dataset.
         * @return The chart.
        private JFreeChart createChart(final IntervalCategoryDataset dataset) {
            final JFreeChart chart = ChartFactory.createGanttChart(
                "Ganttchart",  // chart title
                "Task",              // domain axis label
                "Date",              // range axis label
                dataset,             // data
                true,                // include legend
                true,                // tooltips
                false                // urls
    //        chart.getCategoryPlot().getDomainAxis().setMaxCategoryLabelWidthRatio(10.0f);
            return chart;   
    }As for the "run the program in a C:\folder but when i open the
    document in a project workspace, i cant compile the
    above code. Can any one please offer me assistance?"The run time error that i get is "java.lang.NoSuchMethodError: main
    Exception in thread "main" "
    Please give me some leads on how i can cont to proceed?
    Thanks a lot

  • Help needed with message: "Exception creating new Poolable object"

    In r12.1.3 EBS users occasionally instead of getting the login screen will see the following message *"Unable to generate forwarding URL. Exception: oracle.apps.fnd.common.AppsException: oracle.apps.fnd.common.PoolException: Exception creating new Poolable object"* Restarting the applications usually resolves the issue but it happens so infrequently that we've been unable to diagnose the problem or recreate the problem at will.
    Any assistance would be greatly be appreciated in diagnosing the problem.
    We've logged an SR with Oracle Support and they recommended turning on OC4J Debugging which they advised would create large log files. Since we can replicate this issue at will we would like to avoid turning on debugging and creating the large log files.

    user6035136 wrote:
    In r12.1.3 EBS users occasionally instead of getting the login screen will see the following message *"Unable to generate forwarding URL. Exception: oracle.apps.fnd.common.AppsException: oracle.apps.fnd.common.PoolException: Exception creating new Poolable object"* Restarting the applications usually resolves the issue but it happens so infrequently that we've been unable to diagnose the problem or recreate the problem at will.
    Any assistance would be greatly be appreciated in diagnosing the problem.
    We've logged an SR with Oracle Support and they recommended turning on OC4J Debugging which they advised would create large log files. Since we can replicate this issue at will we would like to avoid turning on debugging and creating the large log files.Can you find any details about the error in the application.log and Apache log files file when the issue happens?
    Do you have the patches in these docs applied?
    Connection Leak On Login [ID 1462034.1]
    Connection Leak: Find LeakedConnectionException Reported in AOLJ Database Connection Pool Test [ID 1177093.1]
    Connection Leaks From fndgfm (fndgfm.java, fndgfm.jsp, _fndgfm.java) [ID 1231393.1]
    Please also see these docs.
    Got Error "Exception: oracle.apps.fnd.common.AppsException: oracle.apps.fnd.common.PoolException: Exception creating new Poolable object" When Login EBS [ID 1485112.1]
    R12: On a cloned target the logon screen reports 'HTTP error 500 Internal server error' [ID 1335176.1]
    Upgrading From 11.510 To R121.3 and Encountered HTTP 500 Internal server [ID 1360410.1]
    Concurrent Requests (Java Based) Failing With NoClassDefFoundError 'Could not initialize class javax.crypto.SunJCE_b' [ID 1423414.1]
    Oracle.Apps.Fnd.Common.Poolexception: Not Able To Create New Database Connection [ID 1434807.1]
    Thanks,
    Hussein

  • I need to pass data from an Access database to Teststand by using the built in Data step types(open data

    base /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1i need to pass data from an Access database to Teststand by using the built in Data step types(open database /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1
    When I tried the same thing on another cmputer the same thing
    happend
    appreiciate u"r help

    base /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1Hello Kitty -
    Certainly it is unusual that you can still see the tables available in your MS Access database but cannot see the columns? I am assuming you are configuring an Open Statement step and are trying to use the ring-control to select columns from your table?
    Can you tell me more about the changes you made to your file when you 'changed' it with MS Access? What version of Access are you using? What happens if you try and manually type in an 'Open Statement Dialog's SQL string such as...
    "SELECT UUT_RESULT.TEST_SOCKET_INDEX, UUT_RESULT.UUT_STATUS, UUT_RESULT.START_DATE_TIME FROM UUT_RESULT"
    Is it able to find the columns even if it can't display them? I am worried that maybe you are using a version of MS Access that is too new for the version of TestSt
    and you are running. Has anything else changed aside from the file you are editing?
    Regards,
    -Elaine R.
    National Instruments
    http://www.ni.com/ask

  • Everytime i need to add a song in my i phone,it always ask for earse and sync option,i need to avoid that a add songs manually.

    everytime i need to add a song in my i phone,it always ask for earse and sync option,i need to avoid that and add songs manually.

    https://support.apple.com/kb/ht1535

  • Hi, I'm developing a application thats need read and log a large tag database at

    Hi, I'm developing a application thats need read and log a large tag database at period of 1 second. My system have actually 1200 tags and when I try to increase the number of tags my system slowdown and not update at requested period anymore. I'm using NI OPC Servers to read data of 4 different PLC's. In the SVE I've created an IO Server to bind variables and all variables are located in a single process. All variables are logging alarms and data. The Log Deadband and Update Deadband are set to 0. My machine is a DELL Precision T5400 with Dual Intel Xeon Quad Core with 4GB of RAM and Windows XP Sp3 installed. Bruno Costa Automation Enginner

    Duplicate Post
    Why did you create an identical post under a different username?
    You'll have to be patient.  It is the 4th of July holiday, so the forums are going to be less active than a usual Monday.

  • I need to  know the name of the database table and the fields in that table

    hi,
    i need to I need to  know the name of the database table and the fields in that table for the following fields of the front end .
    1) incident details.
    2) ownership details
    3) injury type
    4) % of investigation completed withen 7 days.
    5) count of incident type
    6) cost of workers compensation claim.
    7) injury resulting from for workers compensation claim
    8) investigation free text.
    9) investigation contribution factors.
    10) investigation root cause.
    11) investigation root cause free text
    12) employee risk assesment
    13) protential infrigment notice issued
    14) actual infrigment notice issued.
    15) actual infrigment notice reference number.
    16)vehicle damaged text.
    18) when the incident occured.
    thanks and regards,
    pronoy .

    Hello,
    Check CCIHT* under se16 and search for relevant information
    Thanks
    Jayakumar

  • Hello, i have one issue when i hit back button of F Fox than it will show me " Document Expired " alert message.. i need to avoid this alert.

    Hello, i have one issue when i hit back button of F Fox than it will show me " Document Expired " alert message.. i need to avoid this alert.
    because my site is based on ajax so i need same page with my all activity i perform before i go next page when i hit back button..
    Please give me solutions of this problem if possible.
    Thank you

    Are you sending HTTP response headers that instruct Firefox not to cache the pages?
    You can get a "document expired" message if you use the back button to return to a specific page and the web site has instructed Firefox not to cache the page.<br />
    Firefox tries to retrieve the page from the server, possibly by sending POST data.

  • I need to avoid my security question, because i dont remember the answers. and i need to authorize my account in order to purchase from the appstore

    I need to avoid my security questions, i dont know the answers, i dont remember it, and i have 30dlls on my apple id that i cant use cause of the security block. help me, ive been unable to purchase anything for about a 7 months now

    Go to https://iforgot.apple.com and follow the directions.

  • I need to validate Input List Of Values Field when Inserted From Bean

    I've two view object EmployeeView and DepartmentsView
    In Employee View I've changed Department_Id to Input List OF Values
    I've created a bean to inset data into Employee Table
          ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
          ViewObject importedVO = am.findViewObject("EmployeesView");
    try {
                newEmp.setEmployeeId(new Number("3424));
                newEmp.setFirstName("Test Fname");
                newEmp.setLastName("Test Lname");
                newEmp.setEmail("[email protected]");
                newEmp.setPhoneNumber("4643131345");
                newEmp.setJobId("AD_VP");
                newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));
                 } catch (Exception e) {
                // TODO: Add catch code
                System.out.println("inside Catch");
                e.printStackTrace();
            }I know that ADF validate Input list of values when inserting new value on it
    when I've enabled the debugger I've found that
    <ViewObjectImpl><buildQuery> [604] SELECT DepartmentsEO.DEPARTMENT_ID,         DepartmentsEO.DEPARTMENT_NAME,         DepartmentsEO.MANAGER_ID,         DepartmentsEO.LOCATION_ID,         DepartmentsEO.ISDELETED FROM DEPARTMENTS DepartmentsEO WHERE ( ( (DepartmentsEO.DEPARTMENT_ID = :vc_temp_1 ) ) )
    <ViewObjectImpl><bindParametersForCollection> [605] Bind params for ViewObject: [com.test.model.views.DepartmentsEOView]AppModule.__LOCAL_VIEW_USAGE_com_test_model_views_EmployeesEOView_DepartmentsView_findByVC_12_LOV_DepartmentId_lov__filterlist__vcr___
    <OracleSQLBuilderImpl><bindParamValue> [606] Binding param "vc_temp_1": 999
    <ViewObjectImpl><processViewCriteriaForRowMatch> [607] VCs converted to RowMatch:  ( (DepartmentId = :vc_temp_1 ) )
    <ViewRowImpl><handleListBindingMismatch> [608] No matching row found for list binding:LOV_DepartmentId for ViewRow:oracle.jbo.Key[34235 ]
    <ViewRowImpl><handleListBindingMismatch> [609] --- filterList ValueMap key:DepartmentId, value:999
    <DCBindingContainer><internalRefreshControl> [610] **** refreshControl() for BindingContainer :com_test_view_testInsertPageDef
    <JUCtrlHierNodeBinding><release> [611] released: ROOT node binding:noCtrl_oracle_adfinternal_view_faces_model_binding_FacesCtrlHierNodeBinding_2, value:EmployeesViewIterator
    <JUCtrlHierNodeBinding><release> [612] released: ROOT node binding:noCtrl_oracle_adfinternal_view_faces_model_binding_FacesCtrlHierNodeBinding_2, value:EmployeesViewIterator
    <DCIteratorBinding><releaseDataInternal> [613] Releasing iterator binding:EmployeesViewIterator
    <ApplicationPoolMessageHandler><doPoolMessage> [614] **** PoolMessage REQ ATTACH LWS
    <ApplicationPoolMessageHandler><doPoolMessage> [615] **** PoolMessage REQ DETACH LWS
    <DCJboDataControl><initializeApplicationModule> [616] (oracle.adf.model.bc4j.DataControlFactoryImpl.SyncMode = Immediate
    <DCBindingContainer><internalRefreshControl> [617] **** refreshControl() for BindingContainer :com_test_view_testInsertPageDef
    <DCBindingContainerState><validateToken> [618] Process BindingContainer state token(decompressed state):BCST:=0%V%=NEmployeesViewIterator=-D-,
    <this means that ADF tries to validate the input list of values "Department_Id" and didn't found any match
    I need to through exception when I try to set Department_ID with invalid value "value not on range" like
    newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));I don't want to validate it manually as I've a lot of fields.
    I need to through exception when try to
    newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));

    Thanks Timo
    this is the code that I use
          ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
          ViewObject importedVO = am.findViewObject("EmployeesView");
          EmployeesEOViewRowImpl newEmp = (EmployeesEOViewRowImpl)importedVO .createRow();
          importedVO .insertRow(newEmp);
    try {
                newEmp.setEmployeeId(new Number("3424));
                newEmp.setFirstName("Test Fname");
                newEmp.setLastName("Test Lname");
                newEmp.setEmail("[email protected]");
                newEmp.setPhoneNumber("4643131345");
                newEmp.setJobId("AD_VP");
                newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));
                 } catch (Exception e) {
                // TODO: Add catch code
                System.out.println("inside Catch");
                e.printStackTrace();
            }

  • How to avoid booking of stock every time, when ever I make Delivery

    Hello friends,
    Need your help again
    1) When I am making the delivery, at the time of PGI, system asks for sale order stock.
         I donu2019t want to book stock of material against sales order, whenever I make delivery.
    How can I avoid booking of stock every time, when ever I make Delivery?
    2) Can any one tell how we can relate Moment Type with Delivery Type., and how system  recognize which Movement type is to be used for Good Issue and Good Receipt..
    I will be thankful if I may get any response.
    Thanks
    Siddharth

    Hi
    At the time of PGI the system asks for sales order stocks?
    This is picked by the system because of the special stock indicator E in the VOV7 settings of your sales order item category
    If MTO by default the item category will have this special stock indicator E which is correct
    I think you are doing MTS only but your item category is marked with specialstock indicator as E
    Remove this from VOV7 and create a fresh order cycle and see
    Now it will not ask for special stock at the time of PGI
    Dont test it with existing order test it new order cycle after changes in VOV7
    Movement type as all said comes from your schedule line category only in VOV6
    Regards
    Raja

  • Avoid change in PO item field when entering Purchase Requisition no.

    Hi,
    When we enter the Purchase Requisiton no. in the PO item line, the quantity of the PO item is changed to the quantity of what's left of the requisition. We need to avoid this. Does anyone know it it can be done by customizing? Or do I need to use i.e. user-exit?
    Br,
    Line

    You cannot avoid this by any user exit or customizing.
    You must enter the quantity only after referring the PR.
    Best regards
    Ramki

  • Changing exception clause in method signature when overwriting a method

    Hi,
    I stumbled upon a situation by accident and am not really clear on the details surrounding it. A short description:
    Say there is some API with interfaces Foo and Bar as follows:
    public interface Foo {
       void test() throws Exception;
    public interface Bar extends Foo {
       void test();
    }Now, I find it strange that method test() for interface Bar does not need to define Exception in its throws clause. When I first started with Java I was using Java 1.4.2; I now use Java 1.6. I cannot remember ever reading about this before and I have been unable to find an explanation or tutorial on how (or why) this works.
    Consider a more practical example:
    Say there is an API that uses RMI and defines interfaces as follwows:
    public interface RemoteHelper extends Remote {
       public Object select(int uid) throws RemoteException;
    public interface LocalHelper extends RemoteHelper {
       public Object select(int uid);
    }As per the RMI spec every method defined in a Remote interface must define RemoteException in its throws clause. The LocalHelper cannot be exported remotely (this will fail at runtime due to select() in LocalHelper not having RemoteException in its clause if I remember correctly).
    However, an implementing class for LocalHelper could represent a wrapper class for RemoteHelper, like this:
    public class Helper implements LocalHelper {
       private final RemoteHelper helper;
       public Helper(RemoteHelper helper) {
          this.helper = helper;
       public Object select(int id) {
          try {
             return (this.helper.select(id));
          } catch(RemoteException e) {
             // invoke app failure mechanism
    }This can uncouple an app from RMI dependancy. In more practical words: consider a webapp that contains two Servlets: a "startup" servlet and an "invocation" servlet. The startup servlet does nothing (always returns Method Not Allowed, default behaviour of HttpServlet), except locate an RMI Registry upon startup and look up some object bound to it. It can then make this object accessible to other classes through whatever means (i.e. a singleton Engine class).
    The invocation servlet does nothing upon startup, but simply calls some method on the previously acquired remote object. However, the invocation servlet does not need to know that the object is remote. Therefore, if the startup servlet wraps the remote object in another object (using the idea described before) then the invocation servlet is effectively removed from the RMI dependancy. The wrapper class can invoke some sort of failure mechanism upon the singleton engine (i.e. removing the remote object from memory) and optionally throw some other (optionally checked) exception (i.e. IllegalStateException) to the invocation servlet.
    In this way, the invocation servlet is not bound to RMI, there can be a single point where RemoteExceptions are handled and an unchecked exception (i.e. IllegalStateException) can be handled by the Servlet API through an exception error page, displaying a "Service Unavailable" message.
    Sorry for all this extensive text; I just typed out some thoughts. In short, my question is how and why can the throws clause change when overwriting a method? It's nothing I need though, except for the clarity (e.g. is this a bad practice to do?) and was more of an observation than a question.
    PS: Unless I'm mistaken, this is basically called the "Adapter" or "Bridge" (not sure which one it is) pattern (or a close adaptation to it) right (where one class is written to provide access to another class where the method signature is different)?
    Thanks for reading,
    Yuthura

    Yuthura wrote:
    I know it may throw any checked exception, but I'm pretty certain that an interface that extends java.rmi.Remote must include at least java.rmi.RemoteException in its throws clause (unless the spec has changed in Java 1.5/1.6).No.
    A method can always throw fewer exceptions than the one it's overriding. RMI has nothing to do with it.
    See Deitel & Deilte Advanced Java 2 Platform How To Program, 1st Ed. (ISBN 0-13-089650-1), page 793 (sorry, I couldn't find the RMI spec quick enough). Quote: "Each method in a Remote interface must have a throws clause that indicates that the method can throw RemoteException".Which means that there's always a possibility of RemoteException being thrown. That's a different issue. It's not becusae the parent class can throw RE. Rather, it's because some step that will always be followed is declared to throw RE.
    I later also noticed I could not add other checked exceptions, which made sense indeed. Your explanation made perfect sense now that I heard (read) it. But just to humour my curousity, has this always been possible? Yes, Java has always worked that way.
    PS: The overwriting/-riding was a grammatical typo (English is not my native language), but I meant to say what you said.No problem. Minor detail. It's a common mistake, but I always try to encourage proper terminology.

  • Do I need to stop the dbTier or/and appsTier when ... ?

    Do I need to stop the dbTier or/and appsTier when I run
    perl adpreclone.pl dbTier
    perl adpreclone.pl appsTier
    or when I copy the Source System to the Target System (for the appsTier) ?
    Thanks,
    Paul

    Do I need to stop the dbTier or/and appsTier when I run
    perl adpreclone.pl dbTier
    perl adpreclone.pl appsTierThe database and the database listener should be up and running when you run the above two commands. For the application tier, you can keep it up or shut it down.
    or when I copy the Source System to the Target System (for the appsTier) ?It is recommended you shutdown the application services when you copy the application files. Some operating systems do not allow copying file while it is in use (like Windows).

  • I updated the latest version of iOS software on my Macbook Pro and now when I try to open up iPhoto it says that I need to update the latest version. But when I go to update, it says the latest version is unavailable to the U.S. I can't access photos

    I updated the latest version of iOS software on my Macbook Pro and now when I try to open up iPhoto it says that I need to update the latest version. But when I go to update on iTunes, it says the latest version is unavailable to the U.S. I wouldn't mind leaving it be but I can't access any of my photos. What do I do?

    stuckoncc wrote:
    I updated the latest version of iOS software on my Macbook Pro
    iOS is on iPhones and iPads.
    Are you using an iPhone or iPad?

Maybe you are looking for

  • Kernel Panic - not syncing: Attempted to kill init!

    OK, a new issue that I can't resolve... Having made my new kernel without any hiccups, I then installed it by using pacman -A kernel2.6.12.pkg.tar.gz. However, on boot-up it only gets so far, then gives me an error: <0>Kernel Panic - not syncing: Att

  • Track of Addition , Updation and Deletion data in SAP system

    Hi, I am working on extracting data from SAP using 3rd party language into DB, now scenario is as follow everytime i do extraction i have to pull all data again and again which is time consuming now what i am thing of getting only updated data or new

  • Access Denied Error Message in KM

    Hi,   Whenever we publish a Report from Bex Report Designer using Bex Broadcaster the report is getting published in the right KM Folder we choose, but when we click that link with in KM and choose Details we get a message saying "Access Denied". Due

  • Standard report to find free goods sold?

    hello friends,                        my Clint is asking me to generate free goods (tann) reports, could you please suggest me your ideas to generate this report. 

  • I can't sync any music into my iPhone 3G

    In the case of Calendars, Contacts and Mail, they sync right. But when I try to sync my music, nothing happens. iTunes unmounts the iPhone in the exact moment that it is going to sync my songs. The automatic sync I can't afford it, because I have 20