use base 'DBIx::Class::Storage::DBI::UniqueIdentifier';
use mro 'c3';
+use DBI ();
use List::Util 'first';
use namespace::clean;
$columns_info->{$_}{is_auto_increment}
} keys %$columns_info;
- if (not $autoinc_col) {
- $self->throw_exception(
-'empty insert only supported for tables with an autoincrement column'
- );
- }
+ $self->throw_exception(
+ 'empty insert only supported for tables with an autoincrement column'
+ ) unless $autoinc_col;
my $table = $source->from;
$table = $$table if ref $table;
# Unfortunately DBI does not support nested transactions.
# WARNING: this code uses the undocumented 'BegunWork' DBI attribute.
-sub _svp_begin {
+sub _exec_svp_begin {
my ($self, $name) = @_;
- $self->throw_exception(
- 'cannot BEGIN a nested transaction on a disconnected handle'
- ) unless $self->_dbh;
-
local $self->_dbh->{AutoCommit} = 1;
local $self->_dbh->{BegunWork} = 0;
- $self->_dbh_begin_work;
+ $self->_exec_txn_begin;
}
# A new nested transaction on the same level releases the previous one.
-sub _svp_release { 1 }
+sub _exec_svp_release { 1 }
-sub _svp_rollback {
+sub _exec_svp_rollback {
my ($self, $name) = @_;
- $self->throw_exception(
- 'cannot ROLLBACK a nested transaction on a disconnected handle'
- ) unless $self->_dbh;
-
local $self->_dbh->{AutoCommit} = 0;
local $self->_dbh->{BegunWork} = 1;
- $self->_dbh_rollback;
+ $self->_exec_txn_rollback;
}
-1;
-
-=head1 AUTHOR
+=head1 FURTHER QUESTIONS?
-See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
+Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
-=head1 LICENSE
+=head1 COPYRIGHT AND LICENSE
-You may distribute this code under the same terms as Perl itself.
+This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
+by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
+redistribute it and/or modify it under the same terms as the
+L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
=cut
+
+1;
+
# vim:sts=2 sw=2: