From: Philipp Meier Date: 2002-08-28T19:15:51+09:00 Subject: Re: Distributed Object Container --TxukmIqg3MmZ0Kmh Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 28, 2002 at 05:41:58PM +0900, Tom Sawyer wrote: > On Wed, 2002-08-28 at 02:04, Philipp Meier wrote: > > I recently stumbled over OJB (http://jakarta.apache.org/ojb/) which is a > > object relational bridge including a ODMG 3.0 complient API. Although I > > didn't tried it yet I think something like that is missing for ruby. Of > > course, the API must be ruby like. The concept of blocks in ruby would > > be great for transaction demarkation (sic?), e.g. I imagine writing db > > access or generally access to persistent object like this: > >=20 > > def add_item_to_cart(item_ids) > > transaction.serializable do > > @warehouse.queryByValue(:id, item_ids) do |item| > > item.instock -=3D 1 > > @cart[@item] +=3D 1 > > end > > end > > end >=20 > while your example is bit more then i have yet provided, if your are > interested in being able to move you objects in and out of a database > with minimal fuss, i have created DBize (soon to be released as well) it > is primarily a mixin module that makes an object instantly > "relationable". it also provides for subrecords (i.e. many-to-one table > relationships). I remember your post but already made a db persistence mixin myself. What I actually want goes a little further: transactions not tied to a db. That's why i used the example above, a cart usually is held in memory and not in a db. Or think of atomic transactions spanning a db and files or a printer (mark bill as printed in db if and only if it's succesfully printed). -billy. --=20 Meisterbohne S=F6flinger Stra=DFe 100 Tel: +49-731-399 499-0 eL=F6sungen 89077 Ulm Fax: +49-731-399 499-9 --TxukmIqg3MmZ0Kmh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9bKLYfBriNoqItSYRArIlAJ9g449mfZ03vGg2N+UeajMlTlQlRQCfWzLt tmgl5bXrtpPX+RhwEwJDu+0= =3Bzb -----END PGP SIGNATURE----- --TxukmIqg3MmZ0Kmh--