Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

PEAR::DB - DB::connect inconsistency using mysql?
Hi,

 

It seems the DB::connect() method returns a new instance of DB_mysql,
but keeps the same connection if the DSN is the same (looking at the
method and according to PHP's documentation of mysql_connect). This
reveals an inconsistency at the PEAR level, given that you now get a new
instance, but with an existing connection. One would think that getting
a new object would mean getting a new connection. This is a problem when
dealing with transactions: the state of the connection in the object is
lost; there is no reference to whether we are in the middle of a
transaction. Furthermore, an open transaction can be committed using the
new object, but an existing connection!

 

Is there a reason for such behavior?

 

Thanks,

Luis



Report this thread to moderator Post Follow-up to this message
Old Post
Luis Correa D'Almeida
11-26-04 02:02 PM


Re: PEAR::DB - DB::connect inconsistency using mysql?
Luis Correa D'Almeida wrote:
> Hi,
>
>
>
> It seems the DB::connect() method returns a new instance of DB_mysql,
> but keeps the same connection if the DSN is the same (looking at the
> method and according to PHP's documentation of mysql_connect). This
> reveals an inconsistency at the PEAR level, given that you now get a new
> instance, but with an existing connection. One would think that getting
> a new object would mean getting a new connection. This is a problem when
> dealing with transactions: the state of the connection in the object is
> lost; there is no reference to whether we are in the middle of a
> transaction. Furthermore, an open transaction can be committed using the
> new object, but an existing connection!

this is a problem inside the mysql extension .. there is nothing
PEAR::DB can do against this.

regards,
Lukas

Report this thread to moderator Post Follow-up to this message
Old Post
Lukas Smith
11-26-04 02:02 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Pear archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:44 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.