The better place to put EJB Initialization code

I have some stateless session beans that need to be initialied from a few sources
to set
some internal variabes. Where would be the best place to put this code.
In the ejbCreate , in a default constructor, or in the setSessionContext method.
Thanks.

Thanks.
Rob Woollen <[email protected]> wrote:
They're all roughly equivalent.
When the container wants to create a new slsb instance, it will call
the
ctor, setSessionContext, and ejbCreate in that order.
FWIW, setting initial-beans-in-free-pool to > 0 will instruct the
container to precreate instances if you're looking to do that as well.
-- Rob
Tim Bounds wrote:
I have some stateless session beans that need to be initialied froma few sources
to set
some internal variabes. Where would be the best place to put thiscode.
In the ejbCreate , in a default constructor, or in the setSessionContextmethod.
Thanks.

Similar Messages

  • Where is the best place to put custom functions?

    Hi,
    I have a composition which has a number of symbols. I have to call some custom methods externally and was wondering where is the best place to put the custom methods?
    I have seen posts that I should put the code in the CompositionReady event of the stage but I would like to put it a bit closer to the symbol.
    Is this the best place?
    Sham.

    Here is a case:
    It's a good idea if you well understand global and local variables.
    About complete event, you are right.

  • Where is the best place to put cfqueries?

    Where is the best place to put cfqueries, in the <head> </head> or before the html tag? Thanks

    So before the doctype tag? Thanks
    I just doesn't really matter.  the doctype, head, body, etc only matter to the browser; the CF tags only matter to CF.  The browser doesn't see the CFML, and CF doesn't care about the mark-up one bit: it just ignores it.
    The best place - as I said - is not in the same file at all.  But if you insist on slapping your business logic in with your display logic, then the only consideration is that you need to set your variables before you use them.  Other than that: it simply doesn't matter.
    One consideration you might make is - even if it's all thrown into the same one file - at least separate the file itself into sections: have all your CFML code that gets your data at the top, and try to limit the CFML you have mixed in with the mark-up, eg: limit it to stuff like loops and conditionals.
    But, seriously, separate your concerns.  Dan's pretty much just wrong when he said it's over-engineering. It's just sloppy to not to write tidy, well-maintained, well-organised code.
    Adam

  • HT203175 I downloaded two videos from itunes into Media Go and I can't play or transfer them to my Walkman. Please help. I'm new at this and haven't a clue as to what I should do. Is Media Go the wrong place to put the videos? Thanks. Earl G.

    I downloaded two videos from itunes into Media Go and I can't play or transfer them to my Walkman. Please help. I'm new at this and haven't a clue as to what I should do. Is Media Go the wrong place to put the videos? Thanks. Earl G.

    I was able to transfer songs, but not the videos. You, too? Earl. G.

  • Mail under Mavericks_keep failing the right place to put the cursor to rewrite a word

    Mail under Mavericks_keep failing the right place to put the cursor to rewrite a word.
    When I´m writing a mail, if I see an error and want to rewrite a word or a sentence, it´s almost impossible to put the cursor at the right place to rewrite what I need. Most of the times I´ve to erase entire sentences and write everything again.
    Any suggestion for this new problem under Mavericks? Please.
    Thank you.

    https://discussions.apple.com/message/23650743#23650743
    This solved my problem.
    Thanks.

  • The best place to put the global parameter

    hello:
    i am now studying the petstore1.3,and find that the global parameters are kept in the servlet context,i wonder if it is a good solution.in my project,i seldom use the servlet context,session context etc,i feel more like to put the global parameter in a singleton that is loaded when the app is started. i don't know where is the best place to put the global parameter,servlet context or singleton?

    thanks for your answer.
    1 do your mean that the singleton can be shared among the different "war"
    packages if both of them are within the same jvm?if yes,must they be in the
    same "ear" package?
    2 if my app is deployed in the weblogic cluster environment,which one can be
    shared? singleton or servlet context?

  • Where is the correct place to put a property file to be read by bpel ?

    Hi.
    I need to create a custom property file and configure SOA Suite to load it as it's own resource during its start. So i can read this property file from my BPEL embedded activity with some code like this:
    Properties prop = new Properties();
    InputStream in = getClass().getResourceAsStream("foo.properties");
    prop.load(in);
    in.close()
    Avoiding the use of the FileInputStream (constant IO, fixed paths..).
    Is there some default place to put this file ? I have tried to put it under applib and configure this directory as a shared-library directory but without success.
    I'm using SOA Suite 10.1.3.5 with OC4J.
    Thanks.

    Properties can also be defined in and read from bpel.xml. you can define token with any name and define the value for it. In your configuration you can use tokens and at run time it will read the values from bpel.xml.
    Thanks,
    Vikas Manchanda

  • Where is the best place to put programs to start on X/Openbox startup?

    Hi,
    There are several places to put programs to startup when you start X or a WM.  I'm using Openbox and presently have placed these into my .xinitrc file, but I'm not sure this really the best place.  Openbox has a autostart file, which sorta looks like a better bet.
    Any suggestions would be great.
    Thanks,
    Jon

    Hadn't heard of consolekit; it's not clear to me from looking at their website what it's supposed to be offering? Maybe after it matures more, the documentation will improve, and all will become clear.
    When I used Openbox, I just launched everything such as conky from the Openbox autostart file. I guess if you had a weird set up such as some of your Openbox configs sitting on unmounted partitions, their mount commands would go in .xinitrc, otherwise autostart.sh seems better.
    Just IMO of course, do what you want on your own machine :-)
    Last edited by /dev/zero (2011-10-27 21:04:37)

  • Where is the best place to put music for itunes

    I have just downloaded Itunes
    I have a lot of music I want to add to the Itunes Program
    Where do I store the music I have in the Windows 7 there is a folder called music
    do I place all the folders into this (Music Folder)
    and then have Itunes find the music folder and add them into the program
    Is the best way to do it.
    Over time I will add more songs do I just keep placing them into the music folder and have Itunes fiund the new songs and add?
    I need your assistance
    THanks
    Mike

    iTunes will not find files, you need to add them to your library.
    launch iTunes, go preferences > advanced and verify the copy files ... when adding and keep ... organized options are checkmarked.
    next, look inside the iTunes folder for a subfolder called automatically add to iTunes. drop your music files in there. when iTunes has finished adding the files to your library, you may delete the original files.

  • No place to put "redeem redemption code" after signing in???

    Trying to install Elements 13. After signing in, there is no menu or location to enter the redemption code???

    Redemption Code Help
    http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

  • What is the better way to put a kernel badi in a Sap program?

    I'm trying to put a kernel badi into transaction VA01.
    How can I put this new BAdi?, Inside a User Exit?

    Can you explain what is Kernal BADI

  • What are the safest places to put my Macbook Pro charger to prevent it from overheating?

    My charger heats a lot, maybe somebody can give me some tips to prevent my charger from becoming ruined. I wouldn't want to buy a new one.
    Thank you so much.

    Make sure that the wall area  where you plug in the power adapter is well ventilated.
    For more on this:
    http://support.apple.com/kb/HT5234
    Best.

  • Not sure if this is the right place to put this-- Ac adapter question

    I have an original IPOD. I also have an Ipod Touch. Can I use the AC adapter from the original to charge the Touch?

    Thanks
    I didn't think so but I didn't want to mess up the Touch.

  • How to keep minimized files docked in the place you put them and not at bottom of screen?

    I'm using CS3 on Windows. When I minimize a file it automatically goes to the bottom of the screen. How do I get a minimized file to stay where I place it on the screen so that everytime I close the file it will go to the designated place I put it?

    You can't, fort the most part. Windows does not provide this functionality natively. You may be able to enable it by using tools such as Windowblinds or the settings of your graphics card driver, but that's it. Or you could upgrade to CS4, where this is handled by Adobe's own layout engine...
    Mylenium

  • Best place to put cffunctions?

    Hi All,
    I've created a cffunction which I need to access more or less from every page. Where is the best place to put it?
    Can I put it in the Application.cfc? If yes how, and how can I call it from a page?
    Thanks!

    ianskinner wrote:
    Just realize if you are putting the function into the session scope, each and every user is getting an entire copy of the function in the server's memory.
    Depending on the purpose of the function and how you are using it, this may or may not be a lot of memory used up unnecessarily.
    If the function is something that each user does not need their very own copy then it might make more sense to put it into the application scope.  Then there would be one copy of the function that all users utilize.  You could, of course, do that in the OnApplicaitonStart() function of the Application.cfc.
    I agree with Ian that Dan's advice in this case is suboptimal.
    The only things that should go in the session scope are things that specifically related to the session.  Which is not the case here.
    Adam

Maybe you are looking for

  • Internal Kernel Error

    Post Ehp7 upgrade we are facing issue when executing any db related tcodes. Eg: When executing DB02 we are getting the below error message and the workprocess are getting restarted. XXX: SAP System Message: Work process restarted; session terminated

  • Drive partition not mounting

    I had a 400 Gb harddrive which I partitioned in Tiger. Was working fine. Now, in Leopard (after loads of KP's on starting up - see my other post), the first partition (100 Gb) is showing correctly as "backups". The other partition, previously called

  • How to calculate overtime, carry foward leaves, can any body explain

    hi ,, i need to know the over time calculation, carry forward leaves, companesation in the time .. please explain

  • Question to core-processes

    We currently have following configuration set regarding processes: <Process>     <Scope>app</Scope>     <Distribute numprocs="11">insts</Distribute>     <LifeTime>       <RollOver></RollOver>       <MaxCores></MaxCores>     </LifeTime>   <MaxFailures

  • Help!! I can't find Microsoft 2011 AutoRecovery File

    I went to save my paper yesterday without looking at which folding it was going into and I saved it into "Microsoft 2011 AutoRecovery" and now I cannot find that file anywhere!!