On Apr 6, 4:34 pm, Yehuda Katz <[email protected]> wrote:
> This is because DataMapper is mostly used with Merb, which preloads by
> default. On the other hand, Rails tries to preload in development mode. I
> wonder, though, what your item.rb file looks like, because it *should* work.
>

I do not think the item is of any interrest and I have more example
which do not work whenever the application wants to load the children
of an association after restart of the whole application. whenever I
click through application a way where the "item" got loaded before the
children also works fine.

for quite some time I fixed the problem by 'load item.rb' whenever I
saw such an exception in production, but since I preload the all
models I never saw such an error in production.

> > * if you do not like the cookie session store from rails you have
> > nothing left. so put a datamapper_store again into datamapper4rails.
> > since I am about to move verything to rails 2.3.2 the store is for
> > that version (version an older rails is around somewhere on my
> > harddisk). any interest I would be happy to contribute it to
> > rails_datamapper.
>
> It would be great if the DataMapper session code could be shared between
> Merb and Rails. Would you mind looking at the code in merb_datamapper and
> see where it overlaps and whether you can find a way to abstract it so it
> can be used for both frameworks (and maybe all frameworks through Rack).
>
I am offline (or without my development computer) for the next 6
weeks, but after this I will have a look at this.


> > * if you would like to keep the database consistent (within its
> > constraints) then you should wrap a transaction around your actions.
> > dito for the identity maps and for this I made two little classes.
> > again happy they do not have specs yet)
>
> Does this mean you are wrapping a transaction and repository block around
> ever action. Again, it would be great if this could be pulled out into a
> middleware that could be shared between Merb and Rails.
>
>
yes, that is what I do. the transaction I do only for post,put and
delete request assuming that a get does not change the database and
thus does not need any transaction. OK I will look at the middleware
(again after I am back)

>
> > beside some concurrency issue with mysql, datamapper works great for
> > me.
>
> > there is a restful adapter in datamapper4rails. when I last look at
> > the dm-more/adapter is was not in working state. then I had the choice
> > between active_resource and datamapper. since datamapper opened the
> > possibilty to reuse the "model" classes for either using it against
> > the database or against the restful service, I decided to fix the
> > adapter. it works a great way, and it works all the way for my project
> > now, missing are single resources (one without primary keys or keys)
> > and nesting 'has n' children. belongs_to does work as well manually
> > implemented 'has n'. but when I looked to contribute the code, I found
> > a lot of changes. sorry for duplicating.
>
> I don't see why ActiveResource wouldn't work with controllers that used DM.
> If they do not, the specific details would be extremely helpful :)
>

I guess was not clear enough: one the server I want the model Login.get
(..) to retrieve it from the database and on the client I want to get
it from the restful server. i.e. the same model should be
DataMapper::Resource and that is why I drop the active_resource. I
never considered to have a model be a DataMapper::Resource and
ActiveResource at the same time.

with regards
Kristian

>
>
> > with regards Kristian
>
> Great job and thanks for your involvement!
>
>
>
> --
> Yehuda Katz
> Developer | Engine Yard
> (ph) 718.877.1325- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to