Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
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)
X-BeenThere: mybatis-user@googlegroups.com
Received: by 10.52.20.7 with SMTP id j7ls2332344vde.0.gmail; Tue, 25 Sep 2012
 00:32:58 -0700 (PDT)
MIME-Version: 1.0
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)
 smtp.mail=nieme...@freenet.de; dkim=pass
 header...@freenet.de
Received: by d3g2000vbj.googlegroups.com with HTTP; Tue, 25 Sep 2012 00:32:58
 -0700 (PDT)
Date: Tue, 25 Sep 2012 00:32:58 -0700 (PDT)
In-Reply-To: <5060D642.9050108@gmail.com>
References: <75c9bc81-48e2-4843-b8f5-5faa212af265@10g2000vbu.googlegroups.com> <5060D642.9050108@gmail.com>
User-Agent: G2/1.0
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)
Message-ID: <4af91c2f-b1dc-42b4-a2ec-33fc0578feb7@d3g2000vbj.googlegroups.com>
Subject: Re: second JNDI connection with Oracle DBCP (UCP) in web context
From: Andreas Niemeyer <nieme...@freenet.de>
To: mybatis-user <mybatis-user@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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'=
d
> have to create two different session factories, one for each connection
> pool.
>
> --
> Guy Rouillier