Sybase Peristent Connections Gotchas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've been using PHP4/5 and Sybase for several years, using standard
sybase_connect. Today I tried playing around with pconnect to get aquainted.


I expected one simple condition of a "use database" from one web page
affecting another, and easilly handled that with a connection wrapper that
re-uses the proper database with each reconnection.

A couple other more troublesome issues also quickly came up.
1. Any #temp database tables are not destroyed between calls. I can probably
work around this with some minor coding changes to manually drop temp tables.


2. Any call to environmental "set" commands like "set isolation" remain in effect
after the web page is complete. Again with some work I could probably recode some
pages to not change these values, or reset them when complete.


3. The potentially most bothersome would be a page failing to call
commit tran/rollback tran, especially during some error condition. Its easy to think
any uncommited tran is rolled back when the page exists. But persistent connections
won't do this. This could be a disaster by leaving open a transaction causing all
subsequent calls to never be commited... I might be able to create some wrapper
that always resets the transaction state before starting??


I'm curious how others have attempted to solve these problems, and others
I haven't thought of yet.  Clearly many can be avoided by having clean code,
but just 1 exception...

Brian

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux