Hi Rob,

IMO the best is, that every method using the transaction manages it 
itself. so it has the full control, if you have to rollback the 
transaction and something like that. Don't forget, that there could be a 
lot of points in the code, where you need it.

best regards
   Stephan

Erick Fleming schrieb:
> I'm overriding the handle method in my restlet which allow me to
> perform pre and post actions:
>
> override handle(req, res) {
>
>   // begin trans
>   super.handle(req, res)
>   // end trans
>
> }
>
> Don't know if this is best, just what I came up with
>
>
> On 2/26/09, Rob Bugh <[email protected]> wrote:
>   
>> I'm just starting to look at the Restlet API. I have a working example where
>> I can issue GET requests to retrieve a resource. The resource data is fake
>> however (hardcoded into the DAO for the resource). I would like to introduce
>> an OR layer such as Hibernate to allow me to pull the resource data from a
>> database. My concern is with the demarcation of the transaction boundaries
>> when I access the database. Specifically, are there life-cycle methods
>> surrounding the GET request where I could begin and end the transaction?
>>
>>
>> Does anyone have an example they can share that demonstrates how to do this?
>> Or a pointer to some documentation if this has been discussed already.
>>
>>
>> Best regards,
>>
>> Rob
>> --
>> View this message in context:
>> http://n2.nabble.com/Demarcation-Example-tp2389911p2389911.html
>> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1233232
>>     
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1234217

Reply via email to