On 10/27/06, Geoff hendrey <[EMAIL PROTECTED]> wrote:
It's not a singleton. The dbSess, is set into the DAO. I assumes the DAO was not a singleton, so as long as there is a DAO per user's session, there will be a dbSess per user session. The DatabaseSession (dbSess) only keeps two pieces of state:

the dao actually is a singleton - spring is geared towards service layer and most of services and their supporting classes are singletons because they are usually stateless. so you might need some hook into spring to either have a shadessession-per-request or shadessession-per-httpsession perhaps by proxying the session in spring with a bean that can retrieve it from the appropriate scope. spring 2 supports scopes - like session/request so that might work too. depends on how much time you want to invest into supporting spring.

1) The parameters, which get substituted in for ${} variables.

interesting, so running a query has a sideeffect on the session other then putting some entities into the first level cache?

>same for dbsession if its really meant to be used that way - as a singleton


>need some connection support code to implement
>single-connection-per-request. it sucks that every dao op pulls a connection
>from the datasource imho - cant have transactions that span multiple calls
>to dao?

OK, I just implemented the DAO this way, because it appeared this DAO didn't need anything more. This is part of the DAO coding.

yes it is part of the dao coding, but as i said if you are going to sell shades you have to build the support just like hibernate/ibatis/jdo/etc have scaffolding for spring

>need to get rid of all the try/catch/finally - that code looks scarry and is
>replicated in every method
My thought there was that, sure it could get pushed to some utility class. I'm new to Spring. I don't want to just make some utility class that pushes the code somewhere else. If there's some way to make the try catches go away, by somehow having Spring manage it, that makes sense.

there should be something like openconnectioninview filter in spring or some such that takes care of opening and closing the connection once per request. i would look for something like that.

-igor

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to