On Tue, Jun 26, 2012 at 12:46 PM, Cotton, Joseph B <
bcot...@dpscs.state.md.us> wrote:

> I looked at the Realm documentation for a few minutes, but it appears to
> be intended for User ID and Password verification.
>
> Joseph,

Ignore Martin's JDBCRealm suggestion - his responses don't seem to relate
to your concern

> We wish to have a class running on Tomcat that contains system wide
info
> and multiple database connections into DB2 on the mainframe.   All
other
> apps runing on Tomcat will open an instance of this class to access
> the static info and one of five open connections.  Opening and closing

> database connections is very slow and we wish to leave open the
> connections and just reuse them as needed.

Each webapp exists in isolation - they are all inside the same JVM, so in
theory you could allow them to talk to a single instance. Perhaps it would
be clearer/cleaner to have the common code in a separate JVM, and then use
some kind of RMI to communicate to it? Or perhaps you could have a
background component that performs requests that are queued to
disk/memory/database/message queue?

Perhaps a dumb  question - if the connections are slow to open, that's fine
but just allow each app to have one open and then they can co-exist and you
don't need to worry about all of this?

HTH

Chris
>
> We wrote the class and it runs ok.  Yet to get it to run with an app,
> we need to load the class jar file into the app and references in
> context.xml and web.xml as listed in the documentation. But that
> defeats the purpose of the global app because then there are multiple
> instances of the class.
>
> We tried to insert a reference in <GlobalNamingResources> of
server.xml.
> It doesn't seem to work for us.
>
> Or are we off base with this design?  Is app to app communication
> allowed?  Can I call a class from one app to another without first
> loading the called class into the calling class?
>
> I am using NetBeans IDE 7.1.1, Apache Tomcat 7.0.22 and Java 6.23
> (build 1.6.0_23-b05).  Java 7 is not an option in our shop yet because

> we are supporting a commercial package that breaks when run under Java

> 7.
>
> I would appreciate if the group could point me to the correct
> documentation to do what we are looking for, and perhaps a translation

> of the Tomcat specific terminology and jargon.
>
> Thanks
>
> Joe
>
>
>


---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to