Merge 'trunk' into 'storage-interbase'
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / InterBase.pm
index 22cb19e..e11db5e 100644 (file)
@@ -22,6 +22,11 @@ This class implements autoincrements for Firebird using C<RETURNING>, sets the
 limit dialect to C<FIRST X SKIP X> and provides preliminary
 L<DBIx::Class::InflateColumn::DateTime> support.
 
+You need to use either the
+L<disable_sth_caching|DBIx::Class::Storage::DBI/disable_sth_caching> option or
+L</connect_call_use_softcommit> (see L</CAVEATS>) for your code to function
+correctly with this driver.
+
 For ODBC support, see L<DBIx::Class::Storage::DBI::ODBC::Firebird>.
 
 To turn on L<DBIx::Class::InflateColumn::DateTime> support, see
@@ -34,7 +39,7 @@ sub _prep_for_execute {
   my ($op, $extra_bind, $ident, $args) = @_;
 
   if ($op eq 'insert') {
-    my @pk = $ident->primary_columns;
+    my @pk = $ident->_pri_cols;
     my %pk;
     @pk{@pk} = ();
 
@@ -160,13 +165,27 @@ sub _set_sql_dialect {
   }
 }
 
-# softcommit makes savepoints work
-sub _run_connection_actions {
+=head2 connect_call_use_softcommit
+
+Used as:
+
+  on_connect_call => 'use_softcommit'
+
+In L<connect_info|DBIx::Class::Storage::DBI/connect_info> to set the
+L<DBD::InterBase> C<ib_softcommit> option.
+
+You need either this option or C<< disable_sth_caching => 1 >> for
+L<DBIx::Class> code to function correctly.
+
+The downside of using this option is that your process will B<NOT> see UPDATEs,
+INSERTs and DELETEs from other processes for already open statements.
+
+=cut
+
+sub connect_call_use_softcommit {
   my $self = shift;
 
   $self->_dbh->{ib_softcommit} = 1;
-
-  $self->next::method(@_);
 }
 
 =head2 connect_call_datetime_setup
@@ -267,6 +286,13 @@ sub format_date {
 
 =item *
 
+with L</connect_call_use_softcommit>, you will not be able to see changes made
+to data in other processes. If this is an issue, use
+L<disable_sth_caching|DBIx::Class::Storage::DBI/disable_sth_caching>, this of
+course adversely affects performance.
+
+=item *
+
 C<last_insert_id> support only works for Firebird versions 2 or greater. To
 work with earlier versions, we'll need to figure out how to retrieve the bodies
 of C<BEFORE INSERT> triggers and parse them for the C<GENERATOR> name.