Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Actually, some enterprising folks have already done this mapping of objects to multiple tables -- with inheritance -- using SPOPS. (Search the openinteract-dev mailing list for ESPOPS, or /msg me for a url.) I haven't been able to fold it into the main module yet but I hope to in the near future (~2 months).

Also note that SPOPS doesn't prevent you from doing this, it's just not built-in. There's nothing stopping you from doing:

My::News->global_datasource_handle->{AutoCommit} = 0; eval { $news_article->save; $news_category->save; $news_author->save; foreach my $news_topic ( @topics ) { $news_topic->save; } }; if ( $@ ) { My::News->global_datasource_handle->rollback; } else { My::News->global_datasource_handle->commit; } My::News->global_datasource_handle->{AutoCommit} = 1;

I also have a tickling idea for transactions across multiple datasources, but that is much further in the future.

And SPOPS may take advantage of the DBI features you mentioned when they exist and are stable. The SQL abstraction stuff is well-factored so if we wanted to plop something else in there it wouldn't be too difficult.

Chris
M-x auto-bs-mode


In reply to Re: SPOPS, DBI, Business Objects by lachoy
in thread Save MP3 Tag's to Database with SPOPS by jeffa

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 drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-23 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found