EzSql Close Connection and Lazy Loading

Rate this:
By Larry (Contact - View My Woyano)
Published Sat 03 Mar 2007, 791 Views, 2 Comments

First, I want to make sure I don't run into a "too many open connections" error when running my site using ezSql. So I am wondering if there is a way to close a connection when I'm done with it.

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.


This Item
Category: Knowledge, Questions, Technology
Tags: ezsql questions
Share it
Link to this item:
Bookmark this item: RSS Feed

People who liked this item

    2 Comments

  1.  
    JV ~ 18 months ago
    0 votes thumbs up thumbs down
    Basicly this is how ezSQL works by default, can you explain a way that it might not work liek this...
    [ reply ]
    1.  
      Larry ~ 18 months ago
      0 votes thumbs up thumbs down
      My main question was how to close a connection when I'm through with it. I'd still like to know how to do that, as I like to make my code as responsible as possible for cleaning up after itself.

      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
      [ reply ]
      1.  
        22 votes thumbs up thumbs down
        This is my two cents...

           
        Hey you know AdGuy always gets the last word! ;)

      Please Login to Add Your Comment   ..or..  

      Replying to comment by