Which method will be called, when invoking home.create() ?

Hi,
In a Stateless session Bean, I want initialize some variables, whenever a bean is created or retrieved from the pool. So I used the ejbCreate() method to initialize the variables, but it is called only first time when I call the home.create(). If I call the home.create() method next time it doesn't call the ejbCreate().
Which method will be called, whenever I call home.create();.

hi siva,
first of all Ejbcontainers maintain a pool of stateless sessionbeans .when you call home.create() the ejbCreate () method is definitely called and you said you are initializing some variable and may be you are trying to retrive that value after home.create() method.. when you try to retrive the value thee value may be same as you have initialized or different depending upon the no of stateless session beans in the container. you have created a bean and there is no guarantee that the same bean will be called when you invoke retrieval method..
i hope you understood.
cheers

Similar Messages

  • What method will be called when an javabean terminates?

    Hi,
    I am using a java bean in my jsp application with scope "application". I know that this java bean will be terminated only when the server stops or shuts down.
    I need to cleanup something manually when the server shuts down. Can anyone tell me what method will be called, or that I can override, to clean up?
    Please advise.
    Damien

    Hi,
    I tried to implement the ServletContextListener, the ServletContextAttributeListener and the finalize methods, but I find that all of them are not called when I shut down the server manually.
    I am using an Apache Tomcat 4.0 server. I implement the methods as follows:
    public class RTPMainServer implements ServletContextListener, ServletContextAttributeListener
    public void contextDestroyed(ServletContextEvent scb)
    System.out.println("Server shutdown");
    System.out.println(scb.getServletContext());
    sourceSwitch.Cleanup();
    public void contextInitialized (ServletContextEvent scb)
    System.out.println("Server initialized");
    public void attributeAdded (ServletContextAttributeEvent scab)
    System.out.println("Mainserver added");
    public void attributeRemoved (ServletContextAttributeEvent scab)
    System.out.println("MainServer removed");
    public void attributeReplaced (ServletContextAttributeEvent scab)
    System.out.println("Attribute replaced");
    protected void finalize()
    System.out.println("Mainserver garbage collected");
    Can anyone help? Thanks
    Damien

  • Region Monitoring iOS 7 : didEnterRegion method is not calling when app is killed by user or by OS in iOS 7 only. It is working fine when it is in background. and the same code is working fine with iOS 6 for both app in suspended mode and background mode.

    Region Monitoring iOS 7 : didEnterRegion method is not calling when app is killed by user or by OS in iOS 7 only. It is working fine when it is in background. and the same code is working fine with iOS 6 for both app in suspended mode and background mode. What changes I have to made to work great in iOS 7 also.

    I rewrote code for debugging purpose and tried to catch error using GetLastError();  method,
    but it only printed 0. Below is code snippet; I think Create() throw an exception
    and code goes to catch block. 
    LONG ConnectTS(CString strIP, UINT n_Port)
    try{
              ErrorLog(0,0,"ConnectTS is calling Create [is going to call]","");
              if(!Create())
    // Exception Line
    n_Err = GetLastError();
    return NET_INIT;
    catch(...)
                       DWORD errorCode = GetLastError();
                       CString errorMessage
                       errorMessage.Format("%lu",errorCode);
                       ErrorLog (0, 0, "Image
    System", (LPTSTR)(LPCTSTR)errorMessage);
                       return  IS_ERR_WINDOWS;
    Output: -
    ConnectTS is calling Create [is going to call]
    Image System
    0

  • How can i know which index will be used when executing the query ?

    1 ) I have query in which i have 3-4 tables but there multiple index on one column .
    so how can i know which index will be used when executing the query ?
    2) I have a query which ia taking too much time . how can i know which table is taking too much time ?
    3) Please Provide me some document of EXplain plan ?

    Hi Jimmy,
    Consider the below example
    /* Formatted on 2011/02/04 21:59 (Formatter Plus v4.8.8) */
    CREATE TABLE FIRST AS
    SELECT * FROM all_objects;
    UPDATE FIRST
    SET object_name = 'TEST'
    WHERE owner != 'SCOTT';
    CREATE INDEX idx_first ON FIRST(object_name);
    SELECT *
    FROM FIRST
    WHERE object_name = 'TEST';
    It has not used index
    Execution Plan
    Plan hash value: 2265626682
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 58678 | 7334K| 163 (4)| 00:00:02 |
    |* 1 | TABLE ACCESS FULL| FIRST | 58678 | 7334K| 163 (4)| 00:00:02 |
    /* Formatted on 2011/02/04 21:59 (Formatter Plus v4.8.8) */
    SELECT *
    FROM FIRST
    WHERE object_name = 'emp';
    This has used the index
    Execution Plan
    Plan hash value: 1184810458
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 128 | 1 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| FIRST | 1 | 128 | 1 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | IDX_FIRST | 1 | | 1 (0)| 00:00:01 |
    From this we can come to the conclusion that, whether to use one index or not by oracle
    would also depend on the data which is present in the table. This has to be this way as
    we see in the bind peeking, if oracle sticks to only one plan, say only use the full table
    scan, it would be a performance hit when it searches for the second query ie where object_name
    ='emp';
    2.
    If we have a query like below.
    select * from emp
    where upper(ename) = upper(:p_ename);
    Evenif we have the index on ename column, oracle wouldn't be able to use the index, as there is a function in the predicate column. If you need oracle to use the index, we need to create a function based index as below.
    Create index idx_ename on emp(upper(ename));
    Regards,
    Cool

  • Which event will be fired when I after set JFrame.setVisible(false)

    Experts.
    I want to know which event will be fired when I after set JFrame.setVisible(false)?
    Because I need to check a thread is finished it job or not.
    I have checked windowClosing event, but it doesn't work.
    Thanks
    Francis

    Oh....
    Sorry, I find it will fired on componentHidden event.
    Very sorry.

  • Which form will be submitted when i click refresh button.

    HI,
    which form will be submitted when i click on refresh button.

    When you click refresh button, it will send to the server the exact same request that it sent to get to the current page.
    If the previous navigation was done by a form submission, then yes, that form submission will be repeated.

  • While executing the application which method will trigger first

    Hi all,
    while executing a webdynpro application which hooker  method will trigger first?

    Hi Naveen,
    The first method called is the WDDOINIT of the component controller.
    For more details on hook method please see the below link.
    http://wiki.sdn.sap.com/wiki/display/WDABAP/HooksMethodsinWebdynprofor+ABAP
    http://help.sap.com/saphelp_tm70/helpdata/en/45/c87f413e70010de10000000a1550b0/frameset.htm
    Thanks
    Pradeep

  • Which seeded page is called when session timeout happens

    Hi All,
    Our requirement is to route to custom page when session timeout happens. We are working on R11.
    Any suggestions which seeded JSP/JAVA file is called when we try to access application after session time out ?
    How to route to custom page when session timeout happens ?
    Thanks in advance.
    Regards,
    S.K.

    Hi Sk;
    Please check below and see its helpful for your issue,similar topic discussed before here,
    EBS connection time out
    Re: ICX : Session Timeout
    Forms session timeout
    Also check:
    http://www.solutionbeacon.com/best7.htm
    Hope it helps
    Regard
    Helios

  • Which method of JTextPane will be called when it is made visible

    HI,
    Can you please point to some method to override to perform an operation when a JTextPane in panel is shown when ever we swap between tabbed panes.so when i switch to some other tabbed pane and come back to this tabbed where my JTextPane exists so that i can apply some style attributes to data in the JTextPane.
    Regards,
    Sridhar.

    Any easier answer might be to listen for tab changes and use those to apply style attributes.
    DB

  • Which method is being called?

    Hi,
    I have the foll. setup:
    class A{
    func1();
    func2(){
    func1();
    class B extends A{
    func1(); // over-ridden
    super.func2();
    So, when super.func2() is called, and A.func2() is executed, within it does A.func1() get called or does B.func1() get called. If A's method gets called how can I change it to call B's method instead?
    Thanks.

    Write up a quick test case. You can easily find this out for yourself.

  • Echo on outbound calls when on Home Network Extender

    Hello, I'm having serious trouble making outbound calls. Someone in my neighborhood has a network extender.  I get this little house with curvy lines above it that indicate that I'm connected to it while in the basement.  about 80% of the time I make an outbound call it will last from 2-10 seconds, before the other person's end drops, and I hear a perfect echo of my voice. It doesn't sound like an echo though, it's like myself talking back to me. It has about a 1 second delay.  This has happened on 3 different phones over the last 6 months and sometimes takes over 5 calls to finally connect and have it go through and be stable. 
    Has anyone else experienced this?  Is there a way to opt out of a network extender and make my phone only connect to towers?  It's killing me and I need to figure this out as I am about to start up a business and will be making most of my calls from the basement. Thank you!

    Yeah if they white list their own numbers but you may still need a network extender to offset theirs

  • Which system will I get when I do R&R?

    Hello everyone, I have a Lenovo T61 that came preloaded with windows Vista buisness. After a couple of years of using this, lots of junk has gathered up on my computer and rather than going through and deleting thousands of files manually I want to revert my thinkpad back to default factory settings. I understand the process of using R&R to access the computer's hidden partition and restore the computer, etc, etc. But I'm wondering if my system will boot up Windows XP instead of Vista? I have searched a lot and have found very vague answers alluding to either side. I have found very little information about this.
    Has anyone gone through with this procedue who can confirm anything?
    Thanks

    Longinus, welcome to the forum,
    if, as you state, your system came preloaded with Vista running the R&R recovery will reinstall the Vista OS to the factory settings.
    Hope this helps
    Andy  ______________________________________
    Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points
    Did you find a post helpfull? You can thank the member by clicking on the star to the left awarding them Kudos Please add your type, model number and OS to your signature, it helps to help you. Forum Search Option T430 2347-G7U W8 x64, Yoga 10 HD+, Tablet 1838-2BG, T61p 6460-67G W7 x64, T43p 2668-G2G XP, T23 2647-9LG XP, plus a few more. FYI Unsolicited Personal Messages will be ignored.
      Deutsche Community     Comunidad en Español    English Community Русскоязычное Сообщество
    PepperonI blog 

  • Which tool will you use when you design Ejb...I just wanna to know!

    I'm a beginner!@_@
    and,yes,you can help me!
    thank you!

    As for me, good tools are:
    Together ControlCenter 6.0 www.togethersoft.com
    XDoclet
    www.sourceforge.net/projects/xdoclet
    JBuilder 6.0 www.borland.com/jbuilder
    I gave you three tools because they differ from each other a lot.
    TCC is Java/J2EE/UML tool, XDoclet is a JavaDoc extension which can be
    easily added
    to the build process, JBuilder is well-know Java IDE.
    "one_dust" <[email protected]> wrote in message
    news:3cbcfbdd$[email protected]..
    >
    I'm a beginner!@_@
    and,yes,you can help me!
    thank you!

  • Why the method can be called in this way?

    Hi all,
    The following is JAVA SWING TREE custom data models program. There are two files in the program: one is TestFrame.java, and the other is MyDataModel.java. I only posted the important part on the Forum.My question is how method getChild(...) in MyDataModel.java was called in the program? Why I couldn't see the statement like tree.getChild(..) in TestFrame.java? After adding PRINT statements, I know the method getChild(..) was called automatically when object tree was initialized , but I don't know why. Thank you in advance.
    ======
    TestFrame.java
    // Imports
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    class TestFrame extends JFrame
    // Instance attributes used in this example
    private JPanel topPanel;
    private JTree tree;
    private JScrollPane scrollPane;
    // Constructor of main frame
    public TestFrame()
    // Create a new tree control
    MyDataModel treeModel = new MyDataModel( root );
    tree = new JTree(treeModel);
    =========
    ==========
    MyDataModel.java
    import javax.swing.tree.*;
    class MyDataModel extends DefaultTreeModel
    private DefaultMutableTreeNode root;
    private String rootName = "";
    public MyDataModel( TreeNode root )
    super( root );
    DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)root;
    rootName = (String)parentNode.getUserObject();
    System.out.println("rootName is: "+rootName);
    public Object getChild( Object parent, int index )
    DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)parent;
    String parentName = (String)parentNode.getUserObject();
    System.out.println("parentName is: "+parentName);
    if( parentName.equals( rootName ) )
    return super.getChild( parent, index );
    else
    return new DefaultMutableTreeNode( cardArray[index] );
    }

    This is the first time I saw this usage. I understood it now, but I was afraid I missed some important concepts on "interface as parameter in the constructor". Therefore, I am wondering where I can find some online document about it in order to understand the usage clearly.
    For example, if there are a few method implementations of interface TreeModel in MyDataModel.java, which methods will it call after calling JTree constructor? all methods or only part of them?
    Thanks

  • Unreferenced() never called when implementing Unreferenced.

    I have a remote object called DataFacade which implements the Unreferenced interface.
    public class DataFacade extends UnicastRemoteObject implements DataInterface, Unreferenced {
    // some methods
    public void unreferenced() {
    System.out.println("dummy");
    unreferenced() never get called, even though I know there are no more client references to the remote object. Any suggestions?

    unreferenced method only gets called when an exported objects client count has fallen to zero. If you want the object to be unexported and garbage collected all u have to do is to arrange for all local references to be cleared when unreferenced is called.
    So the answer to your question is that your objects are not being unexported successfully.

Maybe you are looking for

  • Looking for Video Card

    My searching through the forum answers some questions, but still wondering ... My 450 AGP (Sawtooth) is going to get a new video card, part of an upgrading I've been doing. ATI Radeon 9800 Pro Mac 128mb? Will this work for my 450? I'm not understandi

  • NullPointerException when opening a script in SQL Developer 4.0.0.12

    I recently upgraded to SQL Developer v.4.0.0.12 64 bit, and am running into some issues. I am running this on 64 bit Windows 7. I have a 64 bit Oracle 11, and in addition have the 32 bit oracle client installed. I made an association between the .sql

  • Is it possible to modify the Calendar object to only show working days?

    Is there a way to configure the Calendar selection, duration calculations, and notification dates in the system to only include working days (i.e. holidays and weekends are not counted and not available for selection)? This is particlular for Purchas

  • How to calculate amount base on Num & Rate

    Dear all, I want to set the calculation in RULE to calculate amount base on number and rate: Amount = number * Rate. I tried: AMT=NUM AMT*RTE But I got error message: "Operatn AMT=N specificatn 'N' is only possible together with P0045 and PRT" Please

  • How to find the Source system table

    Hi Experts, How to find table name in SCM APO system, because I am getting error in process chain, the corresponding  table in the source system does contain any data. check the data basis in the source system. Please provide the solutions how to fin