Revision: 3939
Author: hans
URL: http://bknr.net/trac/changeset/3939
Oops, we certainly did not want to have defined a primary method for
inititialize-instance on user objects.
U branches/anon-transaction-fixes-2/bknr/web/src/sysclasses/user.lisp
Modified: branches/anon-transaction-fixes-2/bknr/web/src/sysclasses/user.lisp
===================================================================
--- branches/anon-transaction-fixes-2/bknr/web/src/sysclasses/user.lisp 2008-09-22 18:23:36 UTC (rev 3938)
+++ branches/anon-transaction-fixes-2/bknr/web/src/sysclasses/user.lisp 2008-09-22 18:31:17 UTC (rev 3939)
@@ -60,7 +60,7 @@
(user-login object)
"unbound"))))
-(defmethod initialize-instance ((user user) &key)
+(defmethod initialize-instance :after ((user user) &key)
(let* ((plaintext-password (slot-value user 'password))
(password (when plaintext-password (crypt-md5 plaintext-password (make-salt)))))
(setf (slot-value user 'password) password)))
Revision: 3937
Author: hans
URL: http://bknr.net/trac/changeset/3937
copy js2 to trunk
A trunk/thirdparty/emacs/js2.el
Change set too large, please see URL above
Revision: 3936
Author: hans
URL: http://bknr.net/trac/changeset/3936
Stop using allocate-instance method for ID allocation again. SBCL
allocates an instance of every class as an optimization for object
creation, and this prototype object was then made part of the class
extent. Instead, the ID is now allocated in initialize-instance.
Lock ID allocation against concurrent access.
U branches/anon-transaction-fixes-2/bknr/datastore/src/data/object-tests.lisp
U branches/anon-transaction-fixes-2/bknr/datastore/src/data/object.lisp
Modified: branches/anon-transaction-fixes-2/bknr/datastore/src/data/object-tests.lisp
===================================================================
--- branches/anon-transaction-fixes-2/bknr/datastore/src/data/object-tests.lisp 2008-09-22 08:06:08 UTC (rev 3935)
+++ branches/anon-transaction-fixes-2/bknr/datastore/src/data/object-tests.lisp 2008-09-22 10:40:42 UTC (rev 3936)
@@ -144,8 +144,8 @@
(defdstest stress-test-2 ()
(bknr.datastore::without-sync ()
(format t "Creating ~A objects~%" +stress-size+)
- (dotimes (i +stress-size+)
- (make-instance 'store-object))
+ (time (dotimes (i +stress-size+)
+ (make-instance 'store-object)))
(format t "Deleting ~A objects~%" (length (all-store-objects)))
(time (map-store-objects #'delete-object))
(test-equal (all-store-objects) nil)))
@@ -169,10 +169,11 @@
(defun object-classes-and-ids ()
"Return a list of conses with the car being a class name and the cdr
being the object id for all persistent objects in the store"
- (mapcar (lambda (object)
- (cons (class-name (class-of object))
- (store-object-id object)))
- (all-store-objects)))
+ (sort (mapcar (lambda (object)
+ (cons (class-name (class-of object))
+ (store-object-id object)))
+ (all-store-objects))
+ #'< :key #'cdr))
(defdstest make-referenced-object-in-anon-tx ()
(with-transaction (:make)
Modified: branches/anon-transaction-fixes-2/bknr/datastore/src/data/object.lisp
===================================================================
--- branches/anon-transaction-fixes-2/bknr/datastore/src/data/object.lisp 2008-09-22 08:06:08 UTC (rev 3935)
+++ branches/anon-transaction-fixes-2/bknr/datastore/src/data/object.lisp 2008-09-22 10:40:42 UTC (rev 3936)
@@ -163,7 +163,9 @@
(remove-if #'transient-slot-p (class-slots class)))
(defclass store-object ()
- ((id :initarg :id :reader store-object-id
+ ((id :initarg :id
+ :reader store-object-id
+ :type integer
:index-type unique-index
:index-initargs (:test #'eql)
:index-reader store-object-with-id :index-values all-store-objects
@@ -220,6 +222,7 @@
(aclmop::finalize-inheritance (find-class 'store-object))
(defmethod initialize-instance :around ((object store-object) &rest initargs &key)
+ (setf (slot-value object 'id) (allocate-next-object-id))
(cond
((not (in-transaction-p))
(with-store-guard ()
@@ -242,14 +245,14 @@
(t
(call-next-method))))
-(defmethod allocate-instance :around ((class persistent-class) &key)
- (let* ((object (call-next-method))
- (subsystem (store-object-subsystem))
- (id (next-object-id subsystem)))
- (setf (slot-value object 'id) id)
- (incf (next-object-id subsystem))
- object))
+(defvar *allocate-object-id-lock* (bt:make-lock "Persistent Object ID Creation"))
+(defun allocate-next-object-id ()
+ (mp-with-lock-held (*allocate-object-id-lock*)
+ (let ((id (next-object-id (store-object-subsystem))))
+ (incf (next-object-id (store-object-subsystem)))
+ id)))
+
(defun initialize-transient-slots (object)
(dolist (slotd (class-slots (class-of object)))
(when (and (typep slotd 'persistent-effective-slot-definition)
@@ -493,15 +496,9 @@
;; If the class is NIL, it was not found in the currently
;; running Lisp image and objects of this class will be ignored.
(when class
- ;; We set the next object ID to allocate in the store to the
- ;; object ID read from the snapshot file. ALLOCATE-INSTANCE
- ;; will assign this object ID to the object and increment the
- ;; counter. This way, we correctly deserialze store snapshots
- ;; which have holes in their ID space (because objects have
- ;; been deleted).
- (setf (next-object-id (store-object-subsystem)) object-id)
(let ((object (allocate-instance class)))
- (assert (= object-id (slot-value object 'id)))
+ (setf (slot-value object 'id) object-id
+ (next-object-id (store-object-subsystem)) (1+ object-id))
(dolist (index (class-slot-indices class 'id))
(index-add index object)))))))
Revision: 3934
Author: hans
URL: http://bknr.net/trac/changeset/3934
Protocol updates
U branches/anon-transaction-fixes-2/bknr/datastore/src/data/blob.lisp
U branches/anon-transaction-fixes-2/bknr/datastore/src/data/package.lisp
U branches/anon-transaction-fixes-2/bknr/datastore/src/data/tests.lisp
U branches/anon-transaction-fixes-2/bknr/datastore/src/data/tutorial.lisp
U branches/anon-transaction-fixes-2/bknr/datastore/src/data/xml-object.lisp
U branches/anon-transaction-fixes-2/bknr/modules/bug/bug-handlers.lisp
U branches/anon-transaction-fixes-2/bknr/modules/comics/comics.lisp
U branches/anon-transaction-fixes-2/bknr/modules/feed/edit-feed-handler.lisp
U branches/anon-transaction-fixes-2/bknr/modules/feed/feed.lisp
U branches/anon-transaction-fixes-2/bknr/modules/imagemap/imagemap.lisp
U branches/anon-transaction-fixes-2/bknr/modules/mail/import-yahoo-group.lisp
U branches/anon-transaction-fixes-2/bknr/modules/mail/mail.lisp
U branches/anon-transaction-fixes-2/bknr/modules/mail/mailinglist-handlers.lisp
U branches/anon-transaction-fixes-2/bknr/modules/mail/mailinglist.lisp
U branches/anon-transaction-fixes-2/bknr/modules/mail/register-handler.lisp
U branches/anon-transaction-fixes-2/bknr/modules/mail/registration.lisp
U branches/anon-transaction-fixes-2/bknr/modules/quizz/edit-quizz-handlers.lisp
U branches/anon-transaction-fixes-2/bknr/modules/stats/stats.lisp
U branches/anon-transaction-fixes-2/bknr/modules/text/article-handlers.lisp
U branches/anon-transaction-fixes-2/bknr/modules/text/article.lisp
U branches/anon-transaction-fixes-2/bknr/modules/text/billboard-handlers.lisp
U branches/anon-transaction-fixes-2/bknr/modules/text/billboard.lisp
U branches/anon-transaction-fixes-2/bknr/modules/text/blog-handlers.lisp
U branches/anon-transaction-fixes-2/bknr/modules/text/paste-handlers.lisp
U branches/anon-transaction-fixes-2/bknr/modules/text/wiki-handlers.lisp
U branches/anon-transaction-fixes-2/bknr/modules/track/track.lisp
U branches/anon-transaction-fixes-2/bknr/modules/url/cached-url-handlers.lisp
U branches/anon-transaction-fixes-2/bknr/modules/url/edit-url-handlers.lisp
U branches/anon-transaction-fixes-2/bknr/web/src/images/image.lisp
U branches/anon-transaction-fixes-2/bknr/web/src/rss/rss.lisp
U branches/anon-transaction-fixes-2/bknr/web/src/sysclasses/cron.lisp
U branches/anon-transaction-fixes-2/bknr/web/src/sysclasses/event.lisp
U branches/anon-transaction-fixes-2/bknr/web/src/sysclasses/sysparam.lisp
U branches/anon-transaction-fixes-2/bknr/web/src/sysclasses/user.lisp
U branches/anon-transaction-fixes-2/bknr/web/src/web/host.lisp
U branches/anon-transaction-fixes-2/projects/bknr-website/src/init.lisp
U branches/anon-transaction-fixes-2/projects/bos/m2/allocation.lisp
U branches/anon-transaction-fixes-2/projects/bos/m2/m2.lisp
U branches/anon-transaction-fixes-2/projects/bos/m2/map.lisp
U branches/anon-transaction-fixes-2/projects/bos/m2/news.lisp
U branches/anon-transaction-fixes-2/projects/bos/m2/poi.lisp
U branches/anon-transaction-fixes-2/projects/bos/web/kml-handlers.lisp
U branches/anon-transaction-fixes-2/projects/bos/web/languages-handler.lisp
U branches/anon-transaction-fixes-2/projects/bos/web/poi-handlers.lisp
U branches/anon-transaction-fixes-2/projects/bos/web/sat-tree.lisp
U branches/anon-transaction-fixes-2/projects/hello-web/src/news.lisp
U branches/anon-transaction-fixes-2/projects/lisp-ecoop/src/handlers.lisp
U branches/anon-transaction-fixes-2/projects/lisp-ecoop/src/participant.lisp
U branches/anon-transaction-fixes-2/projects/lisp-ecoop/src/tags.lisp
U branches/anon-transaction-fixes-2/projects/quickhoney/website/static/javascript.js
U branches/anon-transaction-fixes-2/projects/scrabble/src/game.lisp
U branches/anon-transaction-fixes-2/projects/scrabble/src/rules.lisp
U branches/anon-transaction-fixes-2/projects/scrabble/src/start-webserver.lisp
U branches/anon-transaction-fixes-2/projects/unmaintained/eboy/src/dynasite-tags.lisp
U branches/anon-transaction-fixes-2/projects/unmaintained/eboy/src/item-handlers.lisp
U branches/anon-transaction-fixes-2/projects/unmaintained/gpn/gpn-user.lisp
U branches/anon-transaction-fixes-2/projects/unmaintained/gpn/gpn-web.lisp
U branches/anon-transaction-fixes-2/projects/unmaintained/gpn/zeitplan-handlers.lisp
U branches/anon-transaction-fixes-2/projects/unmaintained/raw-data/mcp/bluetooth.lisp
U branches/anon-transaction-fixes-2/projects/unmaintained/raw-data/mcp/isdn-operator.lisp
U branches/anon-transaction-fixes-2/projects/unmaintained/raw-data/mcp/sensors.lisp
U branches/anon-transaction-fixes-2/projects/unmaintained/saugnapf/src/saugnapf.lisp
Change set too large, please see URL above
Revision: 3932
Author: hans
URL: http://bknr.net/trac/changeset/3932
add js2-mode version 2008016a
A branches/anon-transaction-fixes-2/thirdparty/emacs/js2.el
Change set too large, please see URL above