[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

DRb and MySql

Mohamed Hussain

7/12/2007 3:26:00 PM

Hai
I have created one server using DRb
That server will run 24x7 and i am using MySql Database
Its running perfectly,some times it will get lose the
database and gives the error message
Database gone away
I dont know why this problem occurs
Can any body tell me the solution
Thank You
Bye
By
P.S.Hussain

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

2 Answers

Eric Hodel

7/13/2007 4:29:00 PM

0

On Jul 12, 2007, at 08:26, Mohamed Hussain wrote:

> Hai
> I have created one server using DRb
> That server will run 24x7 and i am using MySql Database
> Its running perfectly,some times it will get lose the
> database and gives the error message
> Database gone away
> I dont know why this problem occurs
> Can any body tell me the solution

MySQL will drop the connection after a certain period of inactivity.

--
Poor workers blame their tools. Good workers build better tools. The
best workers get their tools to do the work for them. -- Syndicate Wars



hemant

7/13/2007 11:45:00 PM

0

On 7/13/07, Eric Hodel <drbrain@segment7.net> wrote:
> On Jul 12, 2007, at 08:26, Mohamed Hussain wrote:
>
> > Hai
> > I have created one server using DRb
> > That server will run 24x7 and i am using MySql Database
> > Its running perfectly,some times it will get lose the
> > database and gives the error message
> > Database gone away
> > I dont know why this problem occurs
> > Can any body tell me the solution
>
> MySQL will drop the connection after a certain period of inactivity.
>

True, also make sure that you are using C version of mysql bindings.

Also often to handle dropped connections people take following apporach:

1. Have a base class that abstracts database connection pooling and
stuff and make sure that you handle the exception in this class and
reconnect to db.
2. Some libs, use a thread that keeps pinging mysql db with some dummy
query so that mysql doesn't drop the connection.

---
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.