-(defun autocommit (&key (database *default-database*) (set :unspecified))
- "Returns whether autocommit is currently active."
- (unless (eq set :unspecified)
- (setf (database-autocommit database) set))
- (database-autocommit database))
+(defun set-autocommit (value &key (database *default-database*))
+ "Turns autocommit off for DATABASE if VALUE is NIL, and
+otherwise turns it on. Returns the old value of autocommit flag.
+For RDBMS (such as Oracle) which don't automatically commit
+changes, turning autocommit on has the effect of explicitly
+committing changes made whenever SQL statements are executed.
+Autocommit is turned on by default."
+ (let ((old-value (database-autocommit database)))
+ (setf (database-autocommit database) value)
+ (database-autocommit database)
+ old-value))
+