>
>
>As mentioned elsewhere, getting a database connection from the web tier
>is not a good practice. The Struts framework does try to encourage best
>practice but sometimes takes a dip in the pool of pragmatism. The
>Generic Connection pool is one example of this. The data access objects
>should take care of all the connection stuff and just pass back standard
>Java objects like JavaBeans and Collections. The web tier, and even
>business tier, does not need to know where the data comes from. 
>  
>
If the data access objects completely encapsulate the connection stuff, 
how does the business object wrap two calls to the data access layer in 
one transaction?  Take for example the well-worn credit and debit 
financial transaction. Would you wrap that up into one data access 
object and say OK, we've got two operations rolled into one and we can't 
seperate them and re-use them, but that's necessary for a transaction?

On the other hand, if the data access objects are handed the connection 
by the business object, or if the connection came from the struts 
connection pool, then the transaction could be handled easily I know. Am 
I chasing a Holy Grail here?

Adam


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to