would i be the first to consider this? has it been done? any ideas on the
fastest way - one could up with alot of marshaling…
-a
···
====================================
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ara.t.howard@noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
~ > ruby -e ‘p(%.\x2d\x29…intern)’
====================================
I don’t really know Madeleine, but I don’t think that there’d be much
conflict between the two frameworks. Transaction::Simple takes a snapshot of
the object at a point in time and keeps it in memory. It doesn’t concern
itself with repeatability of a transaction (as Madeleine does), but it uses
that snapshot to rebuild the object if rewound. It does not reuse the same
object identifiers (unless the object responds to #replace), so anything
that depends on #id will break on a rewind or abort.
Transaction::Simple is used in PDF::Writer to make “test changes” to a PDF
document; if something protected would cross a page boundary, we undo it,
create the page boundary, and then restart the object. So it’s really meant
for “test changes”, not for persistence.
Maybe Madeleine can use Transaction::Simple to gain the ability to rewind
transactions.
-austin
···
On Fri, 19 Sep 2003 02:55:12 +0900, ahoward wrote:
would i be the first to consider this? has it been done? any ideas on
the fastest way - one could up with alot of marshaling…
–
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.09.18
* 17.30.56
On Friday, September 19, 2003, 7:44:07 AM, Austin wrote (in part):
[Transaction::Simple] does not reuse the same object identifiers
(unless the object responds to #replace), so anything that depends
on #id will break on a rewind or abort.
Austin,
Does it concern you at all that an object might implement #replace but
with entirely different semantics? I know it’s not that likely, but
it’s worth considering.
Gavin
A bit. I believe that this would be fixed if, like, #id, we had
#replace. If I don’t test for #replace, though, I would have to do
specific tests for String, Hash, and Array (and other items that support
#replace). Maybe I’ll test two things: respond_to?(:replace) and the #arity
of the method (e.g., 1).
Perhaps this would make a good RCR?
Apparently, there’s another method in 1.8 that I can use to reconstruct the
object without messing up the #id – I just can’t remember it offhand,
and I haven’t had time to look it up in the last two months of methods. If
anyone can remember it, I’d appreciate it.
I am going to be making a change to Transaction::Simple based on what
Madeleine does, by offering alternatives to Marshal in the same way. It’s a
good enhancement, even if Marshal probably provides the most efficient way
of handling the data.
-austin
···
On Fri, 19 Sep 2003 10:37:05 +0900, Gavin Sinclair wrote:
On Friday, September 19, 2003, 7:44:07 AM, Austin wrote (in part):
[Transaction::Simple] does not reuse the same object identifiers
(unless the object responds to #replace), so anything that depends on
#id will break on a rewind or abort.
Does it concern you at all that an object might implement #replace but
with entirely different semantics? I know it’s not that likely, but it’s
worth considering.
–
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.09.18
* 22.41.30