[cl-prevalence-devel] Opening the transaction log - Clozure CL

William Bruschi william.bruschi at gmail.com
Sat Jul 3 13:16:52 UTC 2010


The Clozure CL implementation has added additional keywords to OPEN,
including the :SHARING keyword which controls the access to the stream
by multiple threads. The default value is :PRIVATE, which allows
access to only the thread that created the stream.  More info here:
http://openmcl.clozure.com/manual/chapter9.1.html#CCL-Stream-Extensions

I was using cl-prevalence as a backend for a Weblocks application when
I stumbled upon thread locking errors while accessing the site with
multiple browsers. Setting :SHARING to nil fixed my problem.

Should this be the default behavior for cl-prevalence? After skimming
the code, it appears cl-prevalence has it's own locking mechanisms,
making Clozure's extra keyword arguments unnecessary. I also noticed
in the TODO file that porting to ccl is on the list.

In case anyone is curious, here's how to reproduce the error in
Weblocks:

1. Create a new project as outlined in the bottom of
http://trac.common-lisp.net/cl-weblocks/wiki/UserManual

2. Edit you init-session.lisp file to this:

(defun init-user-session (root)
  (setf (widget-children root)
	(list (make-grid-edit))))

(defclass thing ()
  ((id :initform nil
       :initarg :id
       :accessor thing-id
       :type (or null integer))
   (name :initform nil
	 :initarg :name
	 :accessor thing-name)))

(defun make-grid-edit ()
  (make-instance 'gridedit
		 :data-class 'thing))

3. Open the site using two different browsers. Add a record using each
browser. The second time you add a record, you receive this error:

SIMPLE-ERROR: Stream #<BASIC-FILE-CHARACTER-OUTPUT-STREAM
("/<path-to-file>/transaction-log.xml"/15 ISO-8859-1) #x1987FB3E> is
private to #<PROCESS Hunchentoot worker (client: 127.0.0.1:47448)(14)
[Reset] #x1983AA9E>




More information about the Cl-prevalence-devel mailing list