Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: sqlconnection question

by grashoper (Monk)
on Aug 13, 2009 at 17:16 UTC ( [id://788387]=note: print w/replies, xml ) Need Help??


in reply to Re: sqlconnection question
in thread sqlconnection question

Thanks, I see its not using combined functions so I guess the only option would be to do a re-write of most of it.

Replies are listed 'Best First'.
Re^3: sqlconnection question
by busunsl (Vicar) on Aug 14, 2009 at 07:17 UTC
    Why do you want to close the connection anyway?

    There should be no problem with something like:

    sth1 = prepare select sth1->execute sth2 = prepare select sth2->execute sth3 = prepare insert while () { sth1->fetch sth2->fetch sth3->execute } sth1->finish sth2->finish sth3->finish
    Unless your database prevents having multiple statements at the same time.
Re^3: sqlconnection question
by mje (Curate) on Aug 13, 2009 at 19:32 UTC

    Hang on a minute - you may be rushing to change something you do not need to. The point being made is that if you open a cursor on a result-set, don't retrieve the whole result-set then close the connection you have not got all of the result-set you queried in the first place. So long as you retrieve the result-set via combined DBI functions or otherwise, then closing the connection should not matter. Of course this depends on where you store the results and whether the variables you store the results in go out of scope and are destroyed but the basic principle is go need to retrieve the result-set before closing the connection.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://788387]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found