[Bps-public-commit] r13744 - in DBIx-SearchBuilder/trunk: SearchBuilder/Handle
clkao at bestpractical.com
clkao at bestpractical.com
Wed Jul 2 21:40:23 EDT 2008
Author: clkao
Date: Wed Jul 2 21:40:23 2008
New Revision: 13744
Modified:
DBIx-SearchBuilder/trunk/ (props changed)
DBIx-SearchBuilder/trunk/SearchBuilder/Handle/SQLite.pm
Log:
r31976 at mtl: clkao | 2008-07-02 19:00:14 +0100
When aborting transactions for SQLite, we need to flush our cache,
because SQLite is reusing the primary id for later inserts.
Modified: DBIx-SearchBuilder/trunk/SearchBuilder/Handle/SQLite.pm
==============================================================================
--- DBIx-SearchBuilder/trunk/SearchBuilder/Handle/SQLite.pm (original)
+++ DBIx-SearchBuilder/trunk/SearchBuilder/Handle/SQLite.pm Wed Jul 2 21:40:23 2008
@@ -112,7 +112,24 @@
$$statementref = "SELECT count(*) FROM (SELECT DISTINCT main.id FROM $$statementref )";
}
+=head3 Rollback [FORCE]
+Tells to abort the current SQL transaction.
+
+Method uses C<EndTransaction> method, read its
+L<description|DBIx::SearchBuilder::Handle/EndTransaction>.
+
+The SQLite Rollback has the flush the Record::Cachable cache because
+the primarily keys are reused, unlike many other database systems.
+
+=cut
+
+sub Rollback {
+ my $self = shift;
+ DBIx::SearchBuilder::Record::Cachable->FlushCache
+ if DBIx::SearchBuilder::Record::Cachable->can('FlushCache');
+ $self->SUPER::Rollback(@_);
+}
1;
More information about the Bps-public-commit
mailing list