Message from discussion second JNDI connection with Oracle DBCP (UCP) in web context
Received: by 10.58.222.100 with SMTP id ql4mr3656966vec.22.1348558380553;
Tue, 25 Sep 2012 00:33:00 -0700 (PDT)
Received: by 10.52.20.7 with SMTP id j7ls2332344vde.0.gmail; Tue, 25 Sep 2012
00:32:58 -0700 (PDT)
Received: by 10.52.75.36 with SMTP id z4mr2212211vdv.14.1348558378726; Tue, 25
Sep 2012 00:32:58 -0700 (PDT)
Authentication-Results: ls.google.com; spf=pass (google.com: domain of
nieme...@freenet.de designates internal as permitted sender)
Received: by d3g2000vbj.googlegroups.com with HTTP; Tue, 25 Sep 2012 00:32:58
Date: Tue, 25 Sep 2012 00:32:58 -0700 (PDT)
References: <firstname.lastname@example.org> <5060D642.email@example.com>
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4)
AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2,gzip(gfe)
Subject: Re: second JNDI connection with Oracle DBCP (UCP) in web context
From: Andreas Niemeyer <nieme...@freenet.de>
To: mybatis-user <firstname.lastname@example.org>
Content-Type: text/plain; charset=ISO-8859-1
I will give it a try...
I mean if there is a way to pass a given DB connection object from
somewhere else to initialize the MyBatis stuff only with that single
connection and without any pooling capabilities.
On 24 Sep., 23:53, Guy Rouillier <guy.rouill...@gmail.com> wrote:
> On 9/24/2012 3:05 PM, Andreas Niemeyer wrote:
> > Hi,
> > I've tried to implement an second connection on same JNDI resource in
> > parallel to an given connection pool configuration without success.
> > I got an exception from the UCP driver that the connection pool is
> > already in use. I'm not allowed to change anything in the server.xml
> > in tomcat environment where the connection resource is setup.
> > The given connection pool configuration within the code looks like:
> > mgr =3D
> > UniversalConnectionPoolManagerImpl.getUniversalConnectionPoolManager();
> > pds =3D (oracle.ucp.jdbc.PoolDataSource)
> > envContext.lookup(dataSource);
> > mgr.createConnectionPool((UniversalConnectionPoolAdapter) pds);
> > mgr.startConnectionPool(POOLNAME);
> > mgr.setMetricUpdateInterval(60);
> > mgr.startMetricsCollection(POOLNAME);
> > The POOLNAME constant reflects the property `connectionPoolName' of
> > the resource configuration.
> > It seems to make sense how it behalf with the exception and the UCP
> > driver keeps the pool as registered resource, therefore a second JNDI
> > connection with MyBatis wouldn't be allowed.
> > I'm not motivated to replace the complete UCP stuff due the legacy
> > implementation is needed as I want only extend for new queries.
> > Maybe it should addressed in a OTN group, but hopefully it might
> > possible to cut the corner with a simple question here:
> > Is it possible to initialize the MyBatis configuration with a given
> > sql connection object (which I already have from the UCP connection
> Not clear on what you are attempting to accomplish. =A0However, if you
> want to configure MyBatis to use a defined JNDI pool for one set of
> statements, and then a non-JNDI pool for another, take a look at the
> POOLED datasource element described in the MyBatis documentation. =A0You'=
> have to create two different session factories, one for each connection
> Guy Rouillier