Ramifications of caching results of InitialContext(().lookup?

One of the thing we discovered during our early efforts to port a 5.1 app to
7.0 was that in 7.0 the JNDI lookups were simply taking FOREVER. It was
really horrible.
So, the question is, what are the ramifications of caching the results of
this:
Context ctx = new InitialContext();
SessionBeanHome = (SessionBeanHome) ctx.lookup("SessionBean")
We're guessing that this will fail horrible in a clustered environment, but
what about a stand alone environment?
Thanx!
Will Hartung
([email protected])

Can you provide some statistics, how much time it used to take and how much
is it taking now etc.
In 70, We know that the first InitialContext() call will take some time, as
it needs to initialize kernel and generate the hot-codegened initial context
stub. But once you have this call done, next initialContext call should be
pretty fast.
If you want to avoid the hot-codegen cost of stub, use this work around.
From the browser, try
http://server:port/bea_wls_internal/classes/weblogic/jndi/internal/RootNamin
gNode_WLStub.class
Save this class in your client package. This may give some performance
benefit.
This needs that, your classpath servlet should be turned on. See docs for
more info on this.
But I don't recommend this. This may become an issue later and may generate
version incompatibilities, if you upgrade server and forgot to re-pack the
client etc. I am not sure though.
Hope this helps.
Cheers,
..maruthi
"Will Hartung" <[email protected]> wrote in message
news:3d6a8d58$[email protected]..
One of the thing we discovered during our early efforts to port a 5.1 appto
7.0 was that in 7.0 the JNDI lookups were simply taking FOREVER. It was
really horrible.
So, the question is, what are the ramifications of caching the results of
this:
Context ctx = new InitialContext();
SessionBeanHome = (SessionBeanHome) ctx.lookup("SessionBean")
We're guessing that this will fail horrible in a clustered environment,but
what about a stand alone environment?
Thanx!
Will Hartung
([email protected])

Similar Messages

  • How can i pass a parameter to the query to filter the result of this lookup

    Hello,
    i'm developping a web application with JDeveloper 10.1.2 and JHeadStart.
    i realy need to know how can i filter the lookup (LOV) query result.
    in other word, when i click on the lookup, it show all the row that exist in may data base table.
    what i want is how can i pass a parameter to the query to filter the result of this lookup ?
    Thank you

    Hi,
    have a look if this helps
    http://oracle.com/technology/products/jdev/tips/fnimphius/restrictlovlist/restrictlov.html
    Frank

  • Ibots are not retrieving cached results.

    Hello,
    I have scheduled the ibots on reports available on a dashboard page and added a list of users in the recipients tab. i want the results to be cached for these list of users.
    I get an email with the results of the dashboard report whenever the ibots finish to run. Then i tried to login as one of the users from the list of users in the recipients, but the reports seems to run again without retriving the cached results.
    Can anyone help me to understand why the results are not being cached?
    Thanks,
    sK.

    hi SK,
    check this
    http://www.artofbi.com/index.php/2010/03/obiee-ibots-obi-caching-strategy-with-seeding-cache/
    thanks,
    Saichand.v

  • EJBContext.lookup() vs InitialContext.lookup() @ EJB3.0

    current design of my application uses a helper class for retrieving the system resources. according the new ejb3.0 specs i can't use dependency injection in helper classes. so, if we wanna stay with the current design, we should continue with the 2.1 style initialcontext.lookup.
    my question is if brand new EJBContext.lookup()is just a wrapper that hides direct jndi usage, or there is any deep reason not to use InitialContext.lookup() anymore even if this means that the whole design should be rebuilt from scratch?
    thanks folks!

    Good question :-) EJBContext.lookup() is just a convenience method to make the lookup a bit easier to understand.
    -- It removes the JNDI API from the developer's view.
    -- It removes the notion of "java:comp/env" from the developer's view.
    -- It removes the need to catch a checked exception during the lookup.
    However, the object returned from EJBContext.lookup("abc") is exactly the same as the equivalent new InitialContext().lookup("java:comp/env/abc"). So, you can feel free to use the older more explicit JNDI component environment lookup wherever you'd like, but for code located directly within the bean class, it's easiest to use injection or EJBContext.lookup.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • WLS9.2 caching results of CallableStatement?

    Hello All,
    I've been flummoxed by a problem in which the results of a CallableStatement seem to be cached by our WebLogic 9.2 server. We have a connection pooled DataSource talking to Oracle8i (8.1.7.4.0), configured with 10 statements in a cache and the LRU algorithm, also 1 connection initially and a maximum of 15. We're using Oracle's ojdbc14.jar implementation and orai18n.jar.
    We're mostly executing CallableStatments for packaged procedures/functions that in turn call other procedures or run selects. What I'm geting at is, we're retrieving data rather than updating through our CallableStatement. The retreieved data we extract from the returned oracle ARRAY type using a homegrown map to the "shape" of each Struct underlying the ARRAY collection. In this problem, two CallableStatements are run and return data to our Java app, and at the start all is well. Then the underlying data is changed - via procedures in an oracle forms app on the database, not our Java app. Our Java app should display the changed data. The first CallableStatement runs again and an Eclipse remote debug shows the updated data, however the second CallableStatement continues to return the older data. We have oracle test harnesses that call the same procedures as our CallableStatements; both return the new data. If we leave it for sometime less than 45 minutes, the new data is then returned by both statements. Similarly, if we set the statement cache size to 0, the newe data is returned both times. We're closing the DB resources, (and in the right order: ResultSet, Statement and Connection)
    Has anyone come across this issue before? (From my searches it appears not). Secondly, is there a way of debugging into the WLS DataSource mechanism? I can go down as far as getting the ARRAY and no further, but if there's a switch/command line arg that I could use in the startWeblogic script that'd be great. I remember reading about a WebLogic attributeSpy, (or maybe spyAttribute?) and if I had to try the WLS driver for that I'd give it a go, but if Oracle have something similar that'd be fantastic.
    FWIW, changing the data via the oracle forms app changes the sysdate on the oracle database too.
    Variables from the debug that might be relevant:
    DataSource retrieved from jndi context of type WLEventContextImpl
    driversettings
    weblogic.jdbc.rmi.internal.RmiDriverSettings{verbose=false chunkSize=256 rowCacheSize=0}
    driverProps entrySet [EmulateTwoPhaseCommit=false, connectionPoolID=xxxxx, jdbcTxDataSource=true, LoggingLastResource=false, dataSourceName=xxxxx]
    Connection is PoolConnection_oracle_jdbc_driver_T4CConnection
    weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@5f1
    statement     is CallableStatement_oracle_jdbc_driver_T4CCallableStatement (id=nnnnn)     
    weblogic.jdbc.wrapper.CallableStatement_oracle_jdbc_driver_T4CCallableStatement@5f2
    There is a StatementHolder too:
    weblogic.jdbc.wrapper.CallableStatement_oracle_jdbc_driver_T4CCallableStatement@5f2=weblogic.jdbc.common.internal.StatementHolder@21cae26
    In the "stmts" table in "conn" in "stmt", there are the following two variables:
    jstmt     T4CCallableStatement (id=nnnnn) oracle.jdbc.driver.T4CCallableStatement@21cad44
    key     StatementCacheKey (id=nnnn)     { call my_pack_name.my_proc_name(?,?)}:true:-1:-1
    Thanks for any help that anyone might be able to shed on this!
    Best Regards,
    ConorD

    Hi Joe,
    Thanks for your reply; I'm delighted to see that you're still here helping WLS users under the Oracle banner :-)
    To answer your question, yes, we do get good behaviour when we set the statement cache size to 0. I ran a test on that where I set the Statement cache size to 0 and the initial number of connections to 0, then:
    *1)* Logged in through our Java/WLS app to a few test scenarios and saw the data
    *2)* Ran the oracle app on that DB outside of WLS which moved forward the state of the app, including sysdate
    *3)* Logged in again through our Java/WLS app to the test scenarios and saw the new data being returned from both CallableStatements
    I don't think that the initial number of connections had any effect on this, since WLS was running all the time and there was no retargetting of the DataSource, so IMHO it must have been the statement cache size.
    Where we hadn't got the Statement cache size 0, for step *3)* above one of the two CallableStatements continued to return the old data, (as if it had been told by the DB that the result hadn't changed, and it might as well return a cached result - if WLS does cache ResultSets?)
    Lastly, there is one case where we do see good behaviour even with a Statement cache size of 10:
    Between steps *2)* and *3)* above, if I untarget & activate, then retarget & activate the DataSource (to the same server/db that had just been untargetted) we see new data back from both statements on running step *3)*, even with the Statement cache size set to 10. My guess is that the untarget frees up any object in the Statement cache for collection and removes the remote DB session stubs that may be caching on the DB side.
    Thanks again and Best Regards,
    ConorD

  • Method Iteretor Cache Results Problem

    Hi all,
    I am executing a method and taking some results via method iterator.
    Method iterator Cache Results property is true. But i want to clear or remove all data from cache after completing my job.
    I am trying set to methodIteretor.result property to null in bindings. But this bindings property is unsettable property.
    Thanks to all.
    gokmeni

    Are you attempting to set the property with the Flat editor or within the XML file itself?
    --Ric                                                                                                                                                                                                       

  • Why is my cache results not highligted anymore?

    why is my cache results not highligted anymore?

    When I do a word/s search.
    Normally the words I typed and searched on Google will be highlighted in different colors each word at the top of the webpage.
    The same color will be highligted for each word/s whenever they appears all throught out the page. when I open it as cached.
    Now the words don't highlight any more and no color even.
    Here below info from About.com about what I am asking about:
    http://google.about.com/od/searchingtheweb/qt/cache_syntax.htm
    ''''''Highlight Keywords With Google Cache Search''''''
    Find Specific Information Faster With Google's Cache
    By Marziah Karch, About.com Guide
    Is it hard to find a specific piece of information on a large Web page? You can simply this by using Google's cached page to highlight your search term.
    As Google indexes Web pages, it retains a snapshot of the page contents, known as a cached page. When a cached page is available, you'll see a Cached link at the bottom of the search result.
    Clicking on the Cached link will show you the page as it was last indexed on Google, but with your search keywords highlighted. This is extremely useful if you want to find a specific piece of information without having to scan the entire page.
    Keep in mind that this shows the last time the page was indexed, so sometimes images will not show up and the information will be out of date. For most quick searches, that doesn't matter. You can always go back to the current version of the page and double check to see if the information has changed.

  • NamingException initialContext.lookup

    I have imported a working eclipse J2EE project into JDeveloper 10.1.2.1.0 and fixed some compilation errors by adding the proper libraries. When I run the dcount-ejb project it serves up the login.jsp, but when I attempt to login to the app I get this error:
    05/11/02 13:18:16 $$$getRemoteHome() NamingException:
    initialContext.lookup of java:comp/env/ejb/UsersSBManager
    Error instantiating web-app JNDI-context: No location specified and no suitable instance of the type 'com.cde.decemberCount.ejbJar.users.ejb.SessionBean.UsersSBRemote' found for the ejb-ref ejb/UsersSBManager
    I ran "Verify Enterprise Bean" on UsersSBManager and received:
    Error : Referenced home interface      com.cde.decemberCount.ejbJar.users.ejb.EntityBean.UsersEBRemoteHome not found in project.
    Error : Referenced remote interface
         com.cde.decemberCount.ejbJar.users.ejb.EntityBean.UsersEBRemote
    not found in project.
    I have added the dcount-ejb.jar (containing all the beans including the UsersEBRemote) to my libraries and classpath.
    What else am I forgetting

    In continuing to troubleshoot this problem, I increased the size of the Embedded OC4J Server log and caught this error at the top of the file. I believe it is the core of the problem with the EJB's. I'm hoping its a simple configuration issue:
    05/11/03 08:59:30 Error instantiating application 'current-workspace-app' at file:/H:/DCount/dCount-oc4j-app.xml: Error initializing ejb-module; Exception Unable to find/read assembly info for H:\DCount\ProjectNotes\config\build\lib\classes\com\cde\decemberCount (META-INF/ejb-jar.xml)

  • RFC Look up Caching Results

    Hello Experts,
                I am facing an issue in PI7.1 while using RFC Look up functionality. I use this in a high usage interface and now I see that it actually caches the results somewhere and does not actually make the RFC call to the backend system.
    I refered some threads, but could not get answers. Has anyone else faced this issue ? If yes, could you let me know what the solution is to get around this issue?
    Thanks,
    Karthik

    Thanks Arpil, We are calling the RFC look up once per mapping. We get results into a global variable and process it thereafter. But this interface that has this mapping itself gets called very frequently, around 30 calls per second.
    We are using the RFC look up wizard in PI7.1 and hence not building any new java code etc..but the results are cached. If the data changes in the back end system, the RFC still fetches us old data and only a forced cache refresh is causing it to pick up the new results..

  • Selecting fewer columns from cached results

    If I'm reading the docs right, I should be able to create a request with X number of columns to populate the cache, so that a subsequent request that has a direct subset of those columns would hit the cache. That's not what I'm seeing.
    I have four fact columns in the RPD. The first three, Sales, Cost, and Units, are coming straight from the Physical Layer. The fourth, Profit, is a subtraction of Sales minus Cost.
    Here's what I'm seeing:
    1a. Log In to Answers
    1b. Create Query: Year, Sales, Cost, Profit - this populates the cache.
    1c. Log Out of Answers
    1d. Log back in to Answers
    1e. Create Query: Year, Sales, Cost - this query does NOT hit that cache entry.
    2a. Close all cursors (under Administration...Manage Sessions)
    2b. Log Out
    2c. Purge Cache
    3a. Log In to Answers
    3b. Create Query: Year, Sales, Cost, Units - this populates the cache.
    3c. Log Out of Answers
    3d. Log back in to Answers
    3e Create Query: Year, Sales Cost - this query DOES hit the cache entry.
    The only difference between the two sequences is that one references a calculated column (Profit) and the other does not.
    Incidentally, I've tested this with Profit defined first as a subtraction of the logical columns, and then again as a subtraction of the physical columns, with the same behavior observed both ways.
    Can someone please confirm this behavior and suggest a reason why it should occur?

    Turribeach, here are the Session Logs for each of the four requests. I've interspersed the steps between double-rows of = signs.
    ===================================================
    ===================================================
    STEP 1A: Log In
    STEP 1B: Create request - Year, Sales, Cost, Profit
    ===================================================
    ===================================================
    +++Analyst:320000:320001:----2009/01/15 09:13:51
    -------------------- Logical Request (before navigation):
    RqList
    Times.Year as c1 GB,
    Sales:[DAggr(~Base Facts.Sales by [ Times.Year, Times.Year End Date] )] as c2 GB,
    Cost:[DAggr(~Base Facts.Cost by [ Times.Year, Times.Year End Date] )] as c3 GB,
    Sales:[DAggr(~Base Facts.Sales by [ Times.Year, Times.Year End Date] )] - Cost:[DAggr(~Base Facts.Cost by [ Times.Year, Times.Year End Date] )] as c4 GB,
    Times.Year End Date as c5 GB
    OrderBy: c5 asc
    +++Analyst:320000:320001:----2009/01/15 09:13:51
    -------------------- Sending query to database named BIEE_TRAIN (id: <<1690>>):
    WITH
    SAWITH0 AS (select sum(round(T68.COST , 2)) as c1,
    sum(round(T68.SALES , 2)) as c2,
    T61.YEAR as c3,
    T61.YEAR_END_DATE as c4
    from
    GLOBAL_ADMIN.BI_D_TIME T61,
    GLOBAL_ADMIN.BI_F_SALES T68
    where ( T61.MONTH = T68.MONTH )
    group by T61.YEAR, T61.YEAR_END_DATE)
    select distinct SAWITH0.c3 as c1,
    SAWITH0.c2 as c2,
    SAWITH0.c1 as c3,
    SAWITH0.c2 - SAWITH0.c1 as c4,
    SAWITH0.c4 as c5
    from
    SAWITH0
    order by c5
    +++Analyst:320000:320001:----2009/01/15 09:13:52
    -------------------- Query Result Cache: [59124] The query for user 'Analyst' was inserted into the query result cache. The filename is 'C:\OracleBIData\cache\NQS_TRAINING_733424_33231_00000000.TBL'.
    ===================================================
    ===================================================
    STEP 1C: LOG OUT
    STEP 1D: LOG IN
    STEP 1E: Create request - Year, Sales, Cost
    ===================================================
    ===================================================
    +++Analyst:330000:330001:----2009/01/15 09:17:41
    -------------------- Logical Request (before navigation):
    RqList
    Times.Year as c1 GB,
    Sales:[DAggr(~Base Facts.Sales by [ Times.Year, Times.Year End Date] )] as c2 GB,
    Cost:[DAggr(~Base Facts.Cost by [ Times.Year, Times.Year End Date] )] as c3 GB,
    Times.Year End Date as c4 GB
    OrderBy: c4 asc
    +++Analyst:330000:330001:----2009/01/15 09:17:41
    -------------------- Sending query to database named BIEE_TRAIN (id: <<2062>>):
    select T61.YEAR as c1,
    sum(round(T68.SALES , 2)) as c2,
    sum(round(T68.COST , 2)) as c3,
    T61.YEAR_END_DATE as c4
    from
    GLOBAL_ADMIN.BI_D_TIME T61,
    GLOBAL_ADMIN.BI_F_SALES T68
    where ( T61.MONTH = T68.MONTH )
    group by T61.YEAR, T61.YEAR_END_DATE
    order by c4
    +++Analyst:330000:330001:----2009/01/15 09:17:41
    -------------------- Query Result Cache: [59124] The query for user 'Analyst' was inserted into the query result cache. The filename is 'C:\OracleBIData\cache\NQS_TRAINING_733424_33461_00000001.TBL'.
    *** Note: At this point, there are indeed TWO entries in the cache. ***
    ===================================================
    ===================================================
    STEP 2A: Close all cursors
    STEP 2B: Log Out
    STEP 2C: Purge the cache
    STEP 3B: Create request - Year, Sales, Cost, Units
    ===================================================
    ===================================================
    +++Analyst:350000:350001:----2009/01/15 09:23:18
    -------------------- Logical Request (before navigation):
    RqList
    Times.Year as c1 GB,
    Sales:[DAggr(~Base Facts.Sales by [ Times.Year, Times.Year End Date] )] as c2 GB,
    Cost:[DAggr(~Base Facts.Cost by [ Times.Year, Times.Year End Date] )] as c3 GB,
    Units:[DAggr(~Base Facts.Units by [ Times.Year, Times.Year End Date] )] as c4 GB,
    Times.Year End Date as c5 GB
    OrderBy: c5 asc
    +++Analyst:350000:350001:----2009/01/15 09:23:18
    -------------------- Sending query to database named BIEE_TRAIN (id: <<2399>>):
    select T61.YEAR as c1,
    sum(round(T68.SALES , 2)) as c2,
    sum(round(T68.COST , 2)) as c3,
    sum(round(T68.UNITS , 0)) as c4,
    T61.YEAR_END_DATE as c5
    from
    GLOBAL_ADMIN.BI_D_TIME T61,
    GLOBAL_ADMIN.BI_F_SALES T68
    where ( T61.MONTH = T68.MONTH )
    group by T61.YEAR, T61.YEAR_END_DATE
    order by c5
    +++Analyst:350000:350001:----2009/01/15 09:23:19
    -------------------- Query Result Cache: [59124] The query for user 'Analyst' was inserted into the query result cache. The filename is 'C:\OracleBIData\cache\NQS_TRAINING_733424_33798_00000002.TBL'.
    ===================================================
    ===================================================
    STEP 3C: LOG OUT
    STEP 3D: LOG IN
    STEP 3E: Create request - Year, Sales, Cost
    ===================================================
    ===================================================
    +++Analyst:360000:360001:----2009/01/15 09:24:36
    -------------------- Logical Request (before navigation):
    RqList
    Times.Year as c1 GB,
    Sales:[DAggr(~Base Facts.Sales by [ Times.Year, Times.Year End Date] )] as c2 GB,
    Cost:[DAggr(~Base Facts.Cost by [ Times.Year, Times.Year End Date] )] as c3 GB,
    Times.Year End Date as c4 GB
    OrderBy: c4 asc
    +++Analyst:360000:360001:----2009/01/15 09:24:36
    -------------------- Cache Hit on query:
    Matching Query:     SET VARIABLE QUERY_SRC_CD='Report';SELECT "Time Dimension"."Year" saw_0, "Base Measures".Sales saw_1, "Base Measures".Cost saw_2, "Base Measures".Units saw_3 FROM Global ORDER BY saw_0
    Created by:     Analyst
    +++Analyst:360000:360001:----2009/01/15 09:24:36
    -------------------- Query Status: Successful Completion
    +++Analyst:360000:360001:----2009/01/15 09:24:36
    *** Note: At this point, there is ONE entry in the cache. ***

  • Caching Result Set ?

    folks
    I have a search page which returns a result set and the results are put in the session to be able to access when user clicks on the page numbers(pagination) in the results pane.
    Is there any way we can store or cache this and access instead of fetching it off the session.

    You can store the data as a multi dimensional array in javascript on the rendered jsp page as a javascript function. It exists on the client side (browser) and you can use an onClick event on the page's button to call up various parts of the array and display it to the user. That way, your user doesnt have to submit the page back to the servlet to pagenate to the next page. The data shows up immidiately instead. You'll have to read up on javascript to learn how to do this. (Also I assume you are storing the resultant data in some type of array and not the raw resultSet).
    However, if so much data is returned to the user he needs pagenation, I suggest you add filter textfields to allow him to limit what data is returned so pagenation is not needed. Pagenation implies there is too much data for the user to effectively use at once (no one likes scrolling down a list of 200 items). For instance, instead of displaying all names in a list, add a filter so the user can search for all last names that begain with an A, or B, etc through Z. Then, when displayed to the user, show the list sorted by your filter criteria (lastName). If there is still too much data in the list, I suggest putting up a vertical scrollbar rather than pagenation.

  • Cached results returned from LOV even though query criteria has changed

    Hi,
    JDeveloper 10.1.3.4
    JHeadstart 10.1.3.3.81
    We have a screen that is entered in create row mode. Just prior to entering the screen the user has to select a study for which the record is to be created for. On the screen we have an LOV and a few read-only fields that are populated from the LOV selection. The LOV includes a "study id" as one of its query bind parameters. The data returned by the LOV is very study specific in that a code used in one study will be the same as another however have a very different meaning. We are finding that the first time a code is used, the LOV dialog is shown, however it doesn't get shown again (just automatically populated) for any other further records created even though the user has changed study. It appears as though the code entered by the user is checked against the cache for a match and ignores the fact that the query bind parameter value has changed and should therefore either re-display the LOV dialog or retrieve the results from the correct study.
    The requery condition on the LOV seems irrelevant here (as I changed it to Always and nothing different happened). And of course there isn't a requery condition on the main view object as it is in create row mode.
    Can you point me in the direction of how to clear this cache when a new study is selected? I am unsure how to get at this cache.
    Thanks.

    Barry,
    Hard to help you as it is very specific to your app.
    Can you run in de bug mode and set a breakpoint in LovItemBean.validateWithLOV?
    This should help you find out why the LOV is not shown the second time.
    Steven Davelaar,
    JHeadstart team.

  • Understand InitialContext lookup - Understanding concepts

    I am new to EJB, I am trying to understand the concepts. I am trying to understand example posted on https://glassfish.dev.java.net/javaee5/ejb/examples/Sful.html.
    What I don't understand is how Standalone Java Client is doing the lookup and against what is it doing the lookup. Is it just getting the reference from the class that's packaged in jar file ? If so, then how is it maintaining state of the object - isn't that just as using any other class in the package. I would have thought that there would be some trading service like CORBA where server registers the object and client gets the reference to the object. But, in Client examples that I see it isn't clear how it get's the reference to the object that could either be running on the same host or different host in different JVM i.e being deployed by App server.
    I am trying to understand specifics and can't seem to get simple and good information about it. Could somebody help me in understanding this.
    I want to start this discussion and probably if you guys help me I'll ask some more questions.

    When you deploy an application containing an EJB that exposes a Remote interface, the EJB
    container registers an object representing the Remote EJB in its naming service. The naming
    service lives in the server JVM. The name of the Remote EJB object is vendor-specific. SUN's
    approach for assigning global JNDI names (a.k.a. "mapped" names) is here :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#SessionBeanGlobalJNDINameAssignment
    The portable way to retrieve an EJB reference is to define an EJB dependency and access that
    dependency via a java:comp/env lookup or through dependency injection. However, those options
    are not available to stand-alone Java clients, since stand-alone Java clients are not Java EE
    components. Take a look at the approach used by the Application Client in the Sful example to
    see the difference. There's more on the difference between Application Clients and stand-alone
    Java clients here :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#AppClientDef
    In the case of the stand-alone client, when the no-arg InitialContext is instantiated, the client
    JVM bootstraps a naming provider that knows about the server's naming service. That
    works because the appserv-rt.jar has a jndi.properties file that controls the bootstrapping.
    Since the stand-alone java client can not use the Java EE component environment to access
    the EJB dependency, it is forced to explicitly use a global JNDI name instead. In the example
    you cited, the global JNDI name has defaulted to the fully qualified name of the remote business
    interface.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • POWL: Refresh the cache results of POWL during page load.

    Hi Friends,
    I am using a feeder class for my POWL. Whenever the user clicks opens the POWL, he sees the cached data/results and he is expected to do a manual refresh to see current/new data. I want to eliminate this by refreshing the cache during the page load itself and show user current data. I already know about the exporting parameter in handle_action method which is used to do refresh. But it does not work in this case.
    Pls help.

    Hello Saud,
    In which release you are? in new release you can do refresh by personalization where options are there.
    There are other options also to refresh
    1) By passing URL parameter refreshA=X it will refresh all queies when loading
    2) By passing refreshq=X, it will refresh the current query
    best regards,
    Rohit

  • LoadBalance in InitialContext Lookup

    Hi,
    I'm having following requirement.An Ejb has been deplyed in a weblogic cluster which has two Servers Server A & B.
    In Server A the Ejb is in started mode,& in Server B it is in Stopped state.Now from the server B i'm using a standalone client to lookup the ejb using JNDI name & initial context.
    +          Hashtable env = new Hashtable();+
    +          env.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY , "weblogic.jndi.WLInitialContextFactory" );+
    +          env.put( javax.naming.Context.PROVIDER_URL , "t3://SERVERB:9001,SERVERA:9001" );+
    +          ctx = new InitialContext( env );+
    I had given two URL's [ both Server A & Server B] in the initialcontext. What I'm expecting is the initialcontext will lookup serverB where the EJB is in stopped state, then it will lookup in Server A where the EJB is in started stated & communicate with it.
    But now i'm getting the exception, it is throw from ServerB where the EJB is in Stopped state.
    +Exception in thread "main" javax.naming.NameNotFoundException: Unable to resolve 'XXXEngineBean'. Resolved '' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'XXXEngineBean'. Resolved '']; remaining name 'XXXEngineBean'+
    +     at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)+
    Thanks in Advance

    Hi,
    this may be the same implementation problem of class loading inside SAP NetWeaver Java we stumled oger. I posted an OSS but they will not change it.
    If you have to EJBs in different enterprise applications, you MUST set an application reference from one enterprise application "A" (typically the calling with the lookup) to the enterprise application "B" that contains the EJB that is looked up.
    see [http://help.sap.com/saphelp_nw73/helpdata/en/4a/ee99c229370c9ee10000000a42189c/content.htm]
    "To look up a remote object, you must have its remote interface in the clientu2019s class path (for external clients) or have a class loader reference to it (for components and applications running on the server process)."
    This makes the class loader of "B" the parent class loader of "A". If you omit this reference, the object that is returned by the lookup is loaded by class loader of "B" and you try to cast it to the class of class loader "A" which of course fails.
    Even calling
    PortableRemoteObject.narrow(obj, MyEjbLocalHome .class);
    before the class cast does not help (because it does nothing to obj at all).
    How do you set an application reference?
    In META-INF/application-j2ee-engine.xml in enterprise applicatoin "A" enter
    <?xml version="1.0" encoding="UTF-8"?>
    <application-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="application-j2ee-engine.xsd">
      <reference reference-type="hard">
        <reference-target provider-name="VENDOR_NAME_OF_EAR_B" target-type="application">APP_NAME_OF_EAR_B</reference-target>
      </reference>
    </application-j2ee-engine>
    If you are working with Development Components, just add a dependency with "Runtime" and this is done automatically.
    BTW if you redeploy "B", "A" will be restarted because its parent class loader changed.
    Regards
    Rolf

Maybe you are looking for