All reasonable advice, but if you're going to be doing this a lot, I highly
recommend using a dependency injection framework rather than explicit
singletons. I use Guice, but many people have reported great things of
Spring.
If you need to have your resource injected with dependencies that might b
You are welcomed Anthony. Here you have some 'general' singleton
coding that works 'everywhere' in Java:
public class MySingleton {
private static class MySingletonHolder {
private static final MySingleton INSTANCE = new MySingleton();
}
private MySingleton() {
// You'll do all ini
Fabian,
Being determined to accomplish the task via one of the methods I outlined in
original post I completely neglected to consider this approach.
I'll give the Singleton a go as time is slipping through my fingers.
Thanks Fabian!!!
--
http
Hello Anthony,
I use a single(ton) SessionManager of sorts which 'serves' the
connections when asked, something like:
DBSessionManager.getInstance().getSessionRO();
DBSessionManager.getInstance().getSessionRW();
and of course, the corresponding:
DBSessionManager.getInstance().releaseSessionRO(s
I have a class that handles a pool of Oracle DB connections with methods to get
and free (return to pool) a connection.
This connection pool class will be instantiated in my class that extends
org.restlet.Application.
My question is how to make a connection availble to a ServerResource. Should
5 matches
Mail list logo