Hi Todd
Interestingly we have exactly the same problem. We solve it at deploy time,
namely we deploy a different implementation of a JDBC helper class depending
on whether we are deploying to an EJB appserver or to a stand-alone, single
user laptop.
That way our code doesn't have to do any checking on its environment, eg by
trying to access a service and deciding based on whether or not it exists
whether you are running in an AppServer or not. (Two problems I see with
this approach 1) how can you be sure if the service is there, the appserver
is as well ? and 2) it's inefficient.)
Edward
-----Original Message-----
From: Todd Huss [mailto:[EMAIL PROTECTED]]
Sent: 13 December 2000 19:36
To: [EMAIL PROTECTED]
Subject: [jBoss-User] Discovering if an object is in jboss
I have some java objects that will sometimes be used within jboss, and
othertimes, used outside of jboss. They require JDBC connections and I
have a helper class that they call to get their JDBC connections.
Currently the helper just instantiates a new JDBC connection, however, I'd
like to have the helper class test if it's running inside jboss, and
then instead get the JDBC connection from the JBoss pool in those
cases. What's the best way to do this?
Thanks,
Todd
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]