Re: Restlet and DAO
Hi Jerome Thanks for breaking it down in babysteps for me. ;-) Cheers, Nico -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Restlet-and-DAO-tp4962381p4973512.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2597893
Re: Restlet and DAO
Hi Jerome Thanks for your pointers. If it isn't obvious, I'm quite new to this framework (and actually I'm just an amateur who is also new to web applications ;-)). I also need to apologize, because after searching a bit more I noticed that there was already a similar question in this list about a year ago. I do have a follow-up question. Is there somewhere some example code on how this could be achieved? More specific I'm struggling with the following: if I create my DAO and start the transaction in doInit() of UniformResource, then how do I get a reference to it in ConnectorService, so I can commit or rollback in afterSend? Just let me finish by giving you some more praise. ;-) The framework looks really good, but at the moment it still a bit opaque. I'm looking forward your In Action book and hope that you describe somewhere the steps that are taken from when a request enters the frameworks to when the response leaves, because I still have the feeling I'm missing a lot of the details. (or if you already have a blogpost or something like that describing that in detail, you may always point me in the right direction ;)) Kind regards, Nico jlouvel wrote: > > Hi Nico, > > UniformResource has two methods, doInit() and doRelease() that can be used > for this. However, be careful with your transaction strategy if your > representations need access to the DAO at writing time (after > afterHandle() > is called, in the connector).You can used ServerResource#onSent callback > for > this or the ConnectorService#afterSend method. > > Best regards, > Jerome Louvel > -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Restlet-and-DAO-tp4962381p4972782.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2597753
Re: Restlet and DAO
Yes, I had thought about that, but a filter has a beforeHandle() and a afterHandle() method, so I can easily set up a transaction before the handling and easily perform a commit or a rollback in after the handling. If I would use a BaseResource I would need to add these calls for each extending class, or are there provisions for such a use? Although thinking it through again at this moment, I probably need to overwrite the handle() method in ServerResource to obtain this behaviour? Thanks, Nico -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Restlet-and-DAO-tp4962381p4962438.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2595911
Restlet and DAO
Hi I have a question about how to inject my DAO. I looked around a bit (probably not long enough), and my guess at this point would be that I implement a filter which places the DAO in the attributes of the Request object. Is this the correct modus operandi? What about security? I'm not very keen on putting the DAO in a map where 'everybody' kan retrieve it. kind regards, Nico -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Restlet-and-DAO-tp4962381p4962381.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2595900
Re: create inbound root override problem
If your method name is indeed createInboudRoot(), then you only have made a small typo: there is a n missing in the word inbound. ;) -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/create-inbound-root-override-problem-tp4956547p4961436.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2595701