Accessing Pervasive.SQL With Perl

Page Last Modified:

Home Links ODBC (DBI) Contact

DBI + ODBC - Transactions

Pervasive.SQL supports transactions and therefore we can use the usual DBI flag and methods. By default all queries are committed to the database once they execute correctly - to switch this mode off and enable transactions we need to change the relevant database handle flag:

$dbHandle->{'AutoCommit'} = 0;

which allows us to then use the commit and rollback transaction methods to permanently commit or abandon the changes that have been made. By testing the return values or using eval we can let the program's logic dictate whether commit or rollback is called. If the application quits unexpectedly or the database handle is closed some other way, the transaction will also be rolled back.

See here for an example.

 

Home Links ODBC (DBI) Contact

All content on this site is copyright
Neil Hughes 2010 - 2020