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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.