Re: [Cppcms-users] CPPDB - connection time out
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-07-10 08:43:55
|
1. Please register to mailing list. 2. Take a look on output of strace and see where system call open fails. Also add -f to see threads output Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: "la...@sa..." <la...@sa...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Monday, July 9, 2012 3:41 PM >Subject: Re: [Cppcms-users] CPPDB - connection time out > > > >Hi, > >I runned with strace, but does not say much. > >It fails on stat.exec ( for updates ). > >I am working with multi/thread, can this be a problem? > > >I am doing only one time (before starting the threads) -> cppdb::session sql("sqlite3:db=/home/common/source/DB/Mdata.db"); >And now i also have for each thread: >/////////////////////////////////// >sql.open("sqlite3:db=/home/common/source/DB/Mdata.db"); >... >sql.close(); >//////////////////////////////// > > >This change helps a little, because now instead of having the error at aproximatly 600 seconds i have the error at aproximatly 700 seconds. > > > > >Thanks! >Leandro >Quoting Artyom Beilis <art...@ya...>: >Try to run the program with strace: >> >> strace ./program_name >> >>And see what exactly happens - why sqlite fails to open the DB. >>Maybe something happens there that you are not aware of? >> >>See why open() fails. >> >>Artyom Beilis >>-------------- >>CppCMS - C++ Web Framework: http://cppcms.com/ >>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >> >> >> >>>________________________________ >>> From: "la...@sa..." <la...@sa...> >>>To: Artyom Beilis <art...@ya...>; cpp...@li... >>>Sent: Friday, July 6, 2012 6:16 PM >>>Subject: Re: [Cppcms-users] CPPDB - connection time out >>> >>> >>>The error I am having is: "Error: Unable to open database file". >>> >>>I have a connection -> cppdb::session sql("sqlite3:db=/home/common/source/DB/Mdata.db"); >>> >>>I have a process that does a lot of selects, and updates, but always after aproximatly 600 seconds i get this error, .... I also found that this error occurs when i try to do an update (when i do stat.exec()). >>> >>>my updates are like this (It works fine, on the first 600 seconds, and then it gives an error): >>>////////////////////////////////////////////// >>>stat = sql << "update reading_h set read_id = ?, date = ?, time = ? where read_id = ? and mrg_id = ?" << readId << date << time << headerReadId << mrgId; >>>stat.exec(); >>>stat.reset(); >>>stat.clear(); >>>///////////////////////////////////////////// >>> >>> >>>Quoting Artyom Beilis <art...@ya...>: >>>There is no such thing as "lost a connection" with sqlite3 DB... >>>>The sqlite3 database is a file and database engine operates on the file >>>> >>>>Artyom Beilis >>>>-------------- >>>>CppCMS - C++ Web Framework: http://cppcms.com/ >>>>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>>> >>>> >>>> >>>>>________________________________ >>>>> From: "la...@sa..." <la...@sa...> >>>>>To: cpp...@li... >>>>>Sent: Friday, July 6, 2012 1:58 PM >>>>>Subject: [Cppcms-users] CPPDB - connection time out >>>>> >>>>>Hi, >>>>>I am working with cppdb, with sqlite. >>>>> >>>>>I am doing a connection with cppdb::session >>>>>sql("sqlite3:db=/home/common/source/DB/Mdata.db"); >>>>> >>>>>But i think i lost connection after 600 seconds (10min). I already try >>>>>to change to, 'opt_reconnect = 1', >>>>> >>>>>but still does not work, .... i have always error after 10min. Error: >>>>>Unable to open database connection. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>Thanks, >>>>>Leandro >>>>> >>>>> >>>>> >>>>>------------------------------------------------------------------------------ >>>>>Live Security Virtual Conference >>>>>Exclusive live event will cover all the ways today's security and >>>>>threat landscape has changed and how IT managers can respond. Discussions >>>>>will include endpoint security, mobile security and the latest in malware >>>>>threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>_______________________________________________ >>>>>Cppcms-users mailing list >>>>>Cpp...@li... >>>>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>>> >>>>> >>> >>> >>>------------------------------------------------------------------------------ >>>Live Security Virtual Conference >>>Exclusive live event will cover all the ways today's security and >>>threat landscape has changed and how IT managers can respond. Discussions >>>will include endpoint security, mobile security and the latest in malware >>>threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>_______________________________________________ >>>Cppcms-users mailing list >>>Cpp...@li... >>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> > > > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |