[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

DBI Connect failure - can we retry please?

Dave Smith

5/26/2009 12:30:00 PM

Hi Guys,

I got a DBI connection that tries to connect to a source that sometimes
has an unreliable connection behind it.

DBH = DBI.connect('dbi:ODBC:conenction_name', 'username', 'password')

It has failed a couple of times to connect and just bombs out the
script. As this is to be an automated script it would be nice to be able
to make a couple of attempts at trying to connect before bombing out.

Is anyone able to offer any code and advice as to how best to go about
this? I have looked online but the help is limited.

Many thanks in advance,

Roger
--
Posted via http://www.ruby-....

4 Answers

kennethnoisewater1

4/1/2008 6:04:00 PM

0

On Apr 1, 10:34 am, "Ball of Fluff" <getoffmy...@fluffentology.com>
wrote:
> <kennethnoisewat...@gmail.com> wrote in message
>
> news:178cdaf5-ec6f-4967-b96f-f7c52be1ad2f@q27g2000prf.googlegroups.com...
>
> > On Mar 31, 7:47 pm, PeaceTrainMakesStopatARS...@gmail.com wrote:
> >> Happiness and strength endure only in the absence of hate. To
> >> hate alone is the road to disaster. To love is the road to strength.
> >> To love in spite of all is the secret of greatness. And may very well
> >> be the greatest secret in this universe.
>
> >> L. Ron Hubbard
>
> > L Ron Hubbard absolutely hated SP's, critics and even his son.
>
> > Hubbard's quotes are always so funny because they always contradict
> > everything that he actually did.
>
> I think it's great that he wrote so many inspiring things.
>


Hmmm..... that could be the case. He just sure didn't live by his
quotes. It's like he was saying them for other people and not
himself. But why would he be phony like this? What was he up to? Oh
yeah, now I remember - he was trying to con people into joining a
hypnosis type cult with a sole purpose of extracting money out of
them.

kennethnoisewater1

4/2/2008 3:17:00 AM

0

On Apr 1, 12:26 pm, "Ball of Fluff" <getoffmy...@fluffentology.com>
wrote:
> <kennethnoisewat...@gmail.com> wrote in message
>
> news:38c82c62-e534-4ab9-896c-5d1fdefad522@q27g2000prf.googlegroups.com...
>
>
>
> > On Apr 1, 10:34 am, "Ball of Fluff" <getoffmy...@fluffentology.com>
> > wrote:
> >> <kennethnoisewat...@gmail.com> wrote in message
>
> >>news:178cdaf5-ec6f-4967-b96f-f7c52be1ad2f@q27g2000prf.googlegroups.com...
>
> >> > On Mar 31, 7:47 pm, PeaceTrainMakesStopatARS...@gmail.com wrote:
> >> >> Happiness and strength endure only in the absence of hate. To
> >> >> hate alone is the road to disaster. To love is the road to strength.
> >> >> To love in spite of all is the secret of greatness. And may very well
> >> >> be the greatest secret in this universe.
>
> >> >> L. Ron Hubbard
>
> >> > L Ron Hubbard absolutely hated SP's, critics and even his son.
>
> >> > Hubbard's quotes are always so funny because they always contradict
> >> > everything that he actually did.
>
> >> I think it's great that he wrote so many inspiring things.
>
> > Hmmm..... that could be the case. He just sure didn't live by his
> > quotes. It's like he was saying them for other people and not
> > himself. But why would he be phony like this? What was he up to? Oh
> > yeah, now I remember - he was trying to con people into joining a
> > hypnosis type cult with a sole purpose of extracting money out of
> > them.
>
> I think it's hard to live up to those ideals. I think he did think Scn and
> Dn could help people but I think that he got way too into the power and
> money and that this eventually undid him.
>
> C
>
> www.claireswazey.com

I think that during his rise to power, at times he probably really did
want to help some people. I do think though he got into it only for
the money, and that's actually pretty well documented.

Michael Glaesemann

5/26/2009 1:15:00 PM

0


On May 26, 2009, at 8:29 , Dave Smith wrote:

> It has failed a couple of times to connect and just bombs out the
> script. As this is to be an automated script it would be nice to be
> able
> to make a couple of attempts at trying to connect before bombing out.
>
> Is anyone able to offer any code and advice as to how best to go about
> this? I have looked online but the help is limited.

begin/rescue with a counter?

Michael Glaesemann
grzm seespotcode net




Daniel Berger

5/26/2009 3:31:00 PM

0

> -----Original Message-----
> From: louis.bacon@fourshapes.com [mailto:louis.bacon@fourshapes.com]
> Sent: Tuesday, May 26, 2009 6:30 AM
> To: ruby-talk ML
> Subject: DBI Connect failure - can we retry please?
>=20
> Hi Guys,
>=20
> I got a DBI connection that tries to connect to a source that =
sometimes
> has an unreliable connection behind it.
>=20
> DBH =3D DBI.connect('dbi:ODBC:conenction_name', 'username', =
'password')
>=20
> It has failed a couple of times to connect and just bombs out the
> script. As this is to be an automated script it would be nice to be
> able
> to make a couple of attempts at trying to connect before bombing out.
>=20
> Is anyone able to offer any code and advice as to how best to go about
> this? I have looked online but the help is limited.

gem install attempt

attempt{ dbh =3D DBI.connect(...) }

See http://rubyforge.org/docman/view.php/735/485/R... for more =
details.

Regards,

Dan