X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FOracle%2FGeneric.pm;h=695d4325748f915b8d0b7dcf5dacecfe63f1c961;hb=74b5397c;hp=dc5df6f4bd02d7eaf397b8342aa25ba4da9e04bf;hpb=4b8a53eabdb1629bacdb95f04ca8fc3718ca7c58;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index dc5df6f..695d432 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -103,9 +103,6 @@ sub deployment_statements { my ($schema, $type, $version, $dir, $sqltargs, @rest) = @_; $sqltargs ||= {}; - my $quote_char = $self->schema->storage->sql_maker->quote_char; - $sqltargs->{quote_table_names} = $quote_char ? 1 : 0; - $sqltargs->{quote_field_names} = $quote_char ? 1 : 0; if ( ! exists $sqltargs->{producer_args}{oracle_version} @@ -203,7 +200,7 @@ sub _dbh_get_autoinc_seq { } else { $self->throw_exception( sprintf ( - "Unable to introspect trigger '%s' for column %s.%s (references multiple sequences). " + "Unable to introspect trigger '%s' for column '%s.%s' (references multiple sequences). " . "You need to specify the correct 'sequence' explicitly in '%s's column_info.", $triggers[0]{name}, $source_name, @@ -225,7 +222,7 @@ sub _dbh_get_autoinc_seq { } else { $self->throw_exception( sprintf ( - "Unable to reliably select a BEFORE INSERT trigger for column %s.%s (possibilities: %s). " + "Unable to reliably select a BEFORE INSERT trigger for column '%s.%s' (possibilities: %s). " . "You need to specify the correct 'sequence' explicitly in '%s's column_info.", $source_name, $col, @@ -246,7 +243,7 @@ sub _dbh_get_autoinc_seq { } $self->throw_exception( sprintf ( - "No suitable BEFORE INSERT triggers found for column %s.%s. " + "No suitable BEFORE INSERT triggers found for column '%s.%s'. " . "You need to specify the correct 'sequence' explicitly in '%s's column_info.", $source_name, $col, @@ -284,8 +281,8 @@ sub _ping { } sub _dbh_execute { - #my ($self, $dbh, $sql, $bind, $ident) = @_; - my ($self, $bind) = @_[0,3]; + #my ($self, $dbh, $sql, $bind, $bind_attrs) = @_; + my ($self, $sql, $bind) = @_[0,2,3]; # Turn off sth caching for multi-part LOBs. See _prep_for_execute below local $self->{disable_sth_caching} = 1 if first { @@ -300,26 +297,31 @@ sub _dbh_execute { return shift->$next(@_) if $self->transaction_depth; - # cheat the blockrunner - we do want to rerun things regardless of outer state + # cheat the blockrunner we are just about to create + # we do want to rerun things regardless of outer state local $self->{_in_do_block}; return DBIx::Class::Storage::BlockRunner->new( storage => $self, - run_code => $next, - run_args => \@_, wrap_txn => 0, retry_handler => sub { # ORA-01003: no statement parsed (someone changed the table somehow, # invalidating your cursor.) - return 0 if ($_[0]->retried_count or $_[0]->last_exception !~ /ORA-01003/); - - # re-prepare towards new table data - if (my $dbh = $_[0]->storage->_dbh) { - delete $dbh->{CachedKids}{$_[0]->run_args->[2]}; + if ( + $_[0]->failed_attempt_count == 1 + and + $_[0]->last_exception =~ /ORA-01003/ + and + my $dbh = $_[0]->storage->_dbh + ) { + delete $dbh->{CachedKids}{$sql}; + return 1; + } + else { + return 0; } - return 1; }, - )->run; + )->run( $next, @_ ); } sub _dbh_execute_for_fetch { @@ -419,7 +421,7 @@ sub _dbi_attrs_for_bind { for my $i (0 .. $#$attrs) { if (keys %{$attrs->[$i]||{}} and my $col = $bind->[$i][0]{dbic_colname}) { - $attrs->[$i]{ora_field} = $col; + $attrs->[$i] = { %{$attrs->[$i]}, ora_field => $col }; } } @@ -512,7 +514,7 @@ sub _prep_for_execute { my ($final_sql, @final_binds); if ($op eq 'update') { - $self->throw_exception('Update with complex WHERE clauses currently not supported') + $self->throw_exception('Update with complex WHERE clauses involving BLOB columns currently not supported') if $sql =~ /\bWHERE\b .+ \bWHERE\b/xs; my $where_sql; @@ -633,7 +635,7 @@ Unfortunately, Oracle doesn't support identifiers over 30 chars in length, so the L name is shortened and appended with half of an MD5 hash. -See L. +See L. =cut @@ -644,7 +646,7 @@ sub relname_to_table_alias { my $alias = $self->next::method(@_); # we need to shorten here in addition to the shortening in SQLA itself, - # since the final relnames are a crucial for the join optimizer + # since the final relnames are crucial for the join optimizer return $self->sql_maker->_shorten_identifier($alias); } @@ -761,13 +763,16 @@ It uses the same syntax as L # ORDER SIBLINGS BY # firstname ASC -=head1 AUTHOR +=head1 FURTHER QUESTIONS? -See L and L. +Check the list of L. -=head1 LICENSE +=head1 COPYRIGHT AND LICENSE -You may distribute this code under the same terms as Perl itself. +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L. =cut