Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Because destruction/disconnection related bugs can be hard to find

What is your opinion of DBIx::Connector? Do you think you should delegate the complexity of keeping database connections alive to it?

Also, please note well that destruction bugs and disconnection bugs are two separate classes of problem. I dont know which the use of double quotes about $db was supposed to address. But I do know that common sense about reference counting between a DBIx::Simple database handle and DBIx::Simple::Statement which has-a database handle should not require any particular weakening like you are doing. Just think for a second:

  1. we create a database connection, D
  2. we create a statement instance, S, which refers to D. This makes the reference count for D== 2
  3. we create a another statement instance, S2, which also refers to D. This makes the reference count for D== 3
  4. S2 goes out of scope. Reference count for D drops to 2
  5. S goes out of scope. Reference count for D drops to 1
  6. D goes out of scope, reference count for D drops to 0 and D is extinguished
I simply dont understand why we need to prevent the reference count from naturally increasing and decreasing as the DBIx::Simple instance becomes a compononent of DBIx::Simple::Statement instances.

The trick for wrappers like metaperl's Local::DBIx::Simple could be to somehow keep a reference around and do some of their own lifecycle management.

Without any concrete suggestions for modification, I dont know what to say or try. But I would say this. Local::DBIx::Simple is a very simple, clearly written wrapper and it isnt working.


In reply to Re^10: method chaining fails where separate method calls succeed in DBIx::Simple (lifecycle) by metaperl
in thread method chaining fails where separate method calls succeed in DBIx::Simple by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-16 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found