Also, has anyone looked into making the class "lazy load"? In other words, only establish a connection when one is needed and then cache that connection for the rest of the session, or until the connection was closed (preferably with a class method). If the connection has been closed, obviously the next call to the db should re-connect before executing. This would go a long way to preserving resources and speeding up processing by not actually connecting to the db until it is actually needed.
EzSql Close Connection and Lazy LoadingBy Larry (Contact - View My Woyano)
Published Sat 03 Mar 2007,
791 Views,
2 Comments
|
Also, has anyone looked into making the class "lazy load"? In other words, only establish a connection when one is needed and then cache that connection for the rest of the session, or until the connection was closed (preferably with a class method). If the connection has been closed, obviously the next call to the db should re-connect before executing. This would go a long way to preserving resources and speeding up processing by not actually connecting to the db until it is actually needed.







2 Comments
The "lazy load" question was something I started wondering about as I was entering my "close the connection" question, so I figured I'd ask that too. :)
I'm glad to hear the class employs a "lazy load" mechanism as it is a more responsible way to use the available connections, but again, I'd still like to know how to close an active connection. I'll go through the code on my own, but if you have an answer that would save me some time.
Peace,
Larry
Hey you know AdGuy always gets the last word! ;)