Derek Hohls schrieb:
> Johannes
>
> OK - and I assume the
> } finally {
> //close connection
> }
> won't throw an error if the connection is *not* open?
>
It would throw an error in this case, but you could check if the
connection is open before closing it. However, the error would not be
harmful by leaving any open connections.
> PS If there are any "low entry barriers" (i.e. not getting into Java,
> or having to rewrite everything for Hibernate...) to improving this
> approach, I would be very happy to hear about them.
>
I'm not sure if I have anything to recommend - accessing the DB directly
from flowscript is usually considered messy for a reason. But since I
have done this myself in the past when I just tried to "get things done"
quickly with the few things I knew about cocoon, I'm pretty sure there
are still lots of people out there who do this, even though it's not
supposed to be done like this.
Whatever, something I tried to avoid these complications was to
implement the Data Access Object pattern in flowscript to abstract away
the JDBC calls and push them to a central location. (Yes, you can write
nice object oriented code in Javascript, too). This way I just had to
debug these DAO classes for unclosed connections. I tried to make sure
my methods were atomary transactions, that is, a JDBC connection was
opened at the beginning of the method and closed at the end of it. Maybe
this approach would be something for you to try, if you don't want to go
and implement an Open Session in View filter in Java, which is still the
most elegant solution to the problem by far, but unfortunately can't be
done in flowscript AFAIK.
Regards,
Johannes
> Thanks
> Derek
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]