You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Diran Ayandele <Ad...@Sun.COM> on 2007/08/10 19:16:27 UTC

[Fwd: Passing a connection to ibatis.]

  Hi, I have a flaky oracle 11i grid db that I have to connect to.  
Sometimes it works and sometimes not.  I think this is a problem with 
the tns setup on some of the nodes, but I have no control over any of 
that.  So, I've written a looping connector for the database which 
returns a jdbc Connection when it's finished.  Is there a way I can pass 
this to iBatis?  I'm only using sqlMaps and have no DAO to speak of.  
I'd like to be able to plug this into a SqlMapClient object.

Thanks for any assistance guys!
Diran

Re: [Fwd: Passing a connection to ibatis.]

Posted by Diran Ayandele <Ad...@Sun.COM>.
Clinton,
    Got it - that seems logical.  I'll post my results to this thread 
when I get it working.

Thanks!
Diran

Clinton Begin wrote:
> In that case, you could set up a ping/validation query.  Either in
> SimpleDataSource, DBCP or your app server.  No need to do it yourself.
>
> Cheers,
> Clinton
>
> On 8/10/07, Diran Ayandele <Ad...@sun.com> wrote:
>   
>> Clinton,
>>     Option A - it always fails when first requested or else succeeds.  I
>> run several (6 I think) queries per cycle and once connected never have
>> a problem.  Here is the jdbc url for giggles.
>>  JDBC.ConnectionURL=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=YES)
>> (ADDRESS=(PROTOCOL=tcp)(HOST=fqdn1.domain.sun.com)(PORT=1521))
>> (ADDRESS=(PROTOCOL=tcp)(HOST=fqdn2.domain.sun.com)(PORT=1521))
>> (ADDRESS=(PROTOCOL=tcp)(HOST=fqdn3.domain.sun.com)(PORT=1521))
>> (ADDRESS=(PROTOCOL=tcp)(HOST=fqdn4.domain.sun.com)(PORT=1521))
>> (CONNECT_DATA=(SERVICE_NAME=MYSERVICENAME)))
>>
>> It always works fine when I am testing it in netbeans and regularly
>> fails when I excute it from the jar not that it should make any difference.
>>
>> Diran
>>
>> Clinton Begin wrote:
>>
>>     
>>> Does the driver always fail fast upon requesting it from the data
>>> source?  Or is it possible that even after executing 3 of 5 statements
>>> successfully, it could fail on the 4th?
>>>
>>> Clinton
>>>
>>> On 8/10/07, Diran Ayandele <Ad...@sun.com> wrote:
>>>
>>>
>>>       
>>>>  Hi, I have a flaky oracle 11i grid db that I have to connect to.
>>>> Sometimes it works and sometimes not.  I think this is a problem with
>>>> the tns setup on some of the nodes, but I have no control over any of
>>>> that.  So, I've written a looping connector for the database which
>>>> returns a jdbc Connection when it's finished.  Is there a way I can pass
>>>> this to iBatis?  I'm only using sqlMaps and have no DAO to speak of.
>>>> I'd like to be able to plug this into a SqlMapClient object.
>>>>
>>>> Thanks for any assistance guys!
>>>> Diran
>>>>
>>>>
>>>>
>>>>         

Re: [Fwd: Passing a connection to ibatis.]

Posted by Clinton Begin <cl...@gmail.com>.
In that case, you could set up a ping/validation query.  Either in
SimpleDataSource, DBCP or your app server.  No need to do it yourself.

Cheers,
Clinton

On 8/10/07, Diran Ayandele <Ad...@sun.com> wrote:
> Clinton,
>     Option A - it always fails when first requested or else succeeds.  I
> run several (6 I think) queries per cycle and once connected never have
> a problem.  Here is the jdbc url for giggles.
>  JDBC.ConnectionURL=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=YES)
> (ADDRESS=(PROTOCOL=tcp)(HOST=fqdn1.domain.sun.com)(PORT=1521))
> (ADDRESS=(PROTOCOL=tcp)(HOST=fqdn2.domain.sun.com)(PORT=1521))
> (ADDRESS=(PROTOCOL=tcp)(HOST=fqdn3.domain.sun.com)(PORT=1521))
> (ADDRESS=(PROTOCOL=tcp)(HOST=fqdn4.domain.sun.com)(PORT=1521))
> (CONNECT_DATA=(SERVICE_NAME=MYSERVICENAME)))
>
> It always works fine when I am testing it in netbeans and regularly
> fails when I excute it from the jar not that it should make any difference.
>
> Diran
>
> Clinton Begin wrote:
>
> >Does the driver always fail fast upon requesting it from the data
> >source?  Or is it possible that even after executing 3 of 5 statements
> >successfully, it could fail on the 4th?
> >
> >Clinton
> >
> >On 8/10/07, Diran Ayandele <Ad...@sun.com> wrote:
> >
> >
> >>  Hi, I have a flaky oracle 11i grid db that I have to connect to.
> >>Sometimes it works and sometimes not.  I think this is a problem with
> >>the tns setup on some of the nodes, but I have no control over any of
> >>that.  So, I've written a looping connector for the database which
> >>returns a jdbc Connection when it's finished.  Is there a way I can pass
> >>this to iBatis?  I'm only using sqlMaps and have no DAO to speak of.
> >>I'd like to be able to plug this into a SqlMapClient object.
> >>
> >>Thanks for any assistance guys!
> >>Diran
> >>
> >>
> >>
>

Re: [Fwd: Passing a connection to ibatis.]

Posted by Diran Ayandele <Ad...@Sun.COM>.
Clinton,
    Option A - it always fails when first requested or else succeeds.  I 
run several (6 I think) queries per cycle and once connected never have 
a problem.  Here is the jdbc url for giggles.
 JDBC.ConnectionURL=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=YES)
(ADDRESS=(PROTOCOL=tcp)(HOST=fqdn1.domain.sun.com)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=fqdn2.domain.sun.com)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=fqdn3.domain.sun.com)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=fqdn4.domain.sun.com)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=MYSERVICENAME)))

It always works fine when I am testing it in netbeans and regularly 
fails when I excute it from the jar not that it should make any difference.

Diran

Clinton Begin wrote:

>Does the driver always fail fast upon requesting it from the data
>source?  Or is it possible that even after executing 3 of 5 statements
>successfully, it could fail on the 4th?
>
>Clinton
>
>On 8/10/07, Diran Ayandele <Ad...@sun.com> wrote:
>  
>
>>  Hi, I have a flaky oracle 11i grid db that I have to connect to.
>>Sometimes it works and sometimes not.  I think this is a problem with
>>the tns setup on some of the nodes, but I have no control over any of
>>that.  So, I've written a looping connector for the database which
>>returns a jdbc Connection when it's finished.  Is there a way I can pass
>>this to iBatis?  I'm only using sqlMaps and have no DAO to speak of.
>>I'd like to be able to plug this into a SqlMapClient object.
>>
>>Thanks for any assistance guys!
>>Diran
>>
>>    
>>

Re: [Fwd: Passing a connection to ibatis.]

Posted by Clinton Begin <cl...@gmail.com>.
Does the driver always fail fast upon requesting it from the data
source?  Or is it possible that even after executing 3 of 5 statements
successfully, it could fail on the 4th?

Clinton

On 8/10/07, Diran Ayandele <Ad...@sun.com> wrote:
>   Hi, I have a flaky oracle 11i grid db that I have to connect to.
> Sometimes it works and sometimes not.  I think this is a problem with
> the tns setup on some of the nodes, but I have no control over any of
> that.  So, I've written a looping connector for the database which
> returns a jdbc Connection when it's finished.  Is there a way I can pass
> this to iBatis?  I'm only using sqlMaps and have no DAO to speak of.
> I'd like to be able to plug this into a SqlMapClient object.
>
> Thanks for any assistance guys!
> Diran
>