in reply to Re: Can i execute two queries connecting to same DB at a time.
in thread Can i execute two queries connecting to same DB at a time.
Yes, this is a workaround. But it comes at a cost: Transactions are per connection, not per program. You can't rollback two SQL commands that work on two connections. You can rollback each one separately, but not both at once. And yes, this is an important difference.
If you use more than one connection, use only one distinct conection for database modifications (insert, update, delete), and the other connections only for reading (select). This way, transactions still work.
Another workaround is to buffer the results from the first SQL statement, finish() it, and then process the next SQL statement.
An even better solution is to get a proper RDBMS. There are several available, some even free as in beer and speech.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Can i execute two queries connecting to same DB at a time.
by tilly (Archbishop) on May 07, 2009 at 20:34 UTC | |
|
Re^3: Can i execute two queries connecting to same DB at a time.
by Jenda (Abbot) on May 08, 2009 at 00:37 UTC | |
by afoken (Chancellor) on May 09, 2009 at 01:33 UTC | |
by Jenda (Abbot) on May 10, 2009 at 12:05 UTC | |
by mje (Curate) on May 11, 2009 at 13:14 UTC |