dbTalk Databases Forums  

problem with keeping track of Connection instance

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss problem with keeping track of Connection instance in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
 
Posts: n/a

Default problem with keeping track of Connection instance - 01-01-2006 , 04:27 PM






Hello,

I'm trying to build a program that establishes a connection with the mysql server and save the mysqlpp::connection instance in memory throughout the execution of the application. When I try to do this and get a Query after calling query() from the connection instance and after that call store() my application closes. I've tried to debug this issue and have not come to a solution or to figure out what's causing this.

I got this information from gdb.
#0 mysqlpp::Lockable::lock (this=0x8086a88) at /usr/local/include/mysql++/lockable.h:139
#1 0x0096787e in mysqlpp::Query::lock (this=0xbfd4abc8) at query.cpp:137
#2 0x00967d59 in mysqlpp::Query::store (this=0xbfd4abc8, str=0x8340d34 "SELECT * FROM SqlUser WHERE SqlUser.username='clsk';") at query.cpp:348
#3 0x00969ac9 in mysqlpp::Query::store (this=0xbfd4abc8, p=@0xbfd4abdc) at query.cpp:388
#4 0x080773e1 in eNetworks::cservice::CommandLOGIN::Parser (this=0x8342c00) at /usr/local/include/mysql++/query.h:372

before the application closes. Apparently the last function being called is the following:
(gdb) step
mysqlpp::Lockable::lock (this=0x8086a88) at /usr/local/include/mysql++/lockable.h:139
139 virtual bool lock() { return pimpl_->lock(); }

....

I'd appreciate I can could get with this issue.
Thank you.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: problem with keeping track of Connection instance - 01-03-2006 , 01:38 PM






alan.alvarez (AT) us (DOT) army.mil wrote:
Quote:
#0 mysqlpp::Lockable::lock (this=0x8086a88) at /usr/local/include/mysql++/lockable.h:139
Wrap the call to Connection::query() in a try block. If it already is,
make sure it's catching std::exception, just to be sure you're catching
everything. I suspect your program is dying due to an uncaught
exception. If so, then catching that exception and calling its what()
method will be educational.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Warren Young
 
Posts: n/a

Default Re: problem with keeping track of Connection instance - 01-05-2006 , 08:56 AM



I'm sending this reply to the mailing list. Please do not reply to me
directly. This sort of traffic belongs on the list.

alan.alvarez (AT) us (DOT) army.mil wrote:
Quote:
Also if I do the same operationg with a local instance of Connection.
(Connecting to the same server etc...) it works just fine.
Okay, can you reduce the problem to a simple example showing how a
global Connection instance fails?

Quote:
I believe my problem has something to do with this:
http://lists.mysql.com/plusplus/4771.
Not likely. That problem was tracked down to a misuse of Visual C++
build settings.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.