dbTalk Databases Forums  

Re : Re: V2.0.1 &VS2003/2005 qry=new Query(con) =>conn

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


Discuss Re : Re: V2.0.1 &VS2003/2005 qry=new Query(con) =>conn in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
np@sfr.fr
 
Posts: n/a

Default Re : Re: V2.0.1 &VS2003/2005 qry=new Query(con) =>conn - 08-18-2005 , 11:20 AM






In fact, just after
qry =3D new Query(con);

qry does not contains th=
e same address in conn_ than con object
it could be then normal that :
=
making a select returns me "connection has gone away"
deleting qry objec=
t crashes cause of that bad pointer

i'll try tonight to have a look at=
the sources near Query(mysqlpp::Conn...)

I can confirm that simple1 i=
s working properly as Connection & query are declared non-pointer in the =
same function under VS 2005

NP.



Quote:
---------- Message d'origine =
-----------
Exp=E9diteur : Warren Young <mysqlpp (AT) etr-usa (DOT) com
A : M=
ySQL++ Mailing List <plusplus (AT) lists (DOT) mysql.com
CC :
Date : Thu, 18=
Aug 2005 10:00:23 -0600
Objet : Re: V2.0.1 & VS2003/2005 qry=3Dnew Qu=
ery(con) =3D> conn inside queryout ...
np (AT) sfr (DOT) fr wrote:
Qry objec=
t does not contain a correct conn_ pointer.

That's not very helpfu=
l. What makes you think it is not valid? Is it
valid right after yo=
u create the Query object? At what point does it
become invalid?
=

PS : i'm not able to run 'makemake vc',

Sorry, make.bat was=
accidentally left out of the distribution. I've
attached the curren=
t version.

I am sending this to the mailing list. Please do not e=
mail me directly.
This sort of thing belongs on the mailing list, w=
here others can
benefit from this exchange.

Code :

=
try {
con =3D new Connection(use_exceptions);
con->conne=
ct(DB_NAME,DB_HOST,DB_USER_NAME,DB_PASSWORD);
if(con!=3DNULL) {
=
qry =3D new Query(con);
a "standalone" usable class
}
=
if(con =3D=3D NULL || con->connected()=3D=3Dfalse) {
Log::A=
ddLog("ERROR Connection failed to MYSQL Server");
return false;=

}
}
catch (BadQuery er ) {
Log::AddLog("ERROR whi=
le connecting to MYSQL Server" + String(er.what()));
return false;=

}
return true;

That looks perfectly reasonable to me.=
What part of it fails?


Liste des noms de fichiers de corps
=

Nicolas PERRIN


--
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.