You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@empire-db.apache.org by Tim Colson <ti...@yahoo.com> on 2013/09/20 20:20:22 UTC

Re: Advice for multi-DAO, nested objects, connection mgt, Spring config, for Click webapp

Hi Rainer -- 
Thanks for the advice/comments, and apologies for my delay'd reply.

> Instead of a PersistenceManger / entity bean combination in Empire-db I use classes derived from DBRecord.
> They essentially represent your business objects and should hold all the business logic (for a single record).

Ties the business objects to the persistence layer fairly tightly, yes? 
Let's assume I get over my initial fear of doing that, can you help me understand the benefits?
Does this pattern eliminate having a business model object + DAO combination?

> connection management is concerned I always use a request based approach
>  i.e. a connection is taken from a connection pool the first time it is required for a request,
> then stored on request scope and automatically released at the end of the request

That sounds like an interesting approach, so the web request gets the connection? When/where do you open the DB? 
I'll be honest, I've never fully understood ThreadLocal -- in this case, why is it a good way to hold onto the connection?

> Concerning "paged" retrieval there are two methods on DBCommand "skipRows" and "limitRows".
> Unfortunately those methods are not yet implemented for all database drivers and in some cases you will get a NotSupportedException.

Thanks for the pointer -- I had a look, and the EmpireDB side seems sensible enough. Then I started down the road researching how to do this correctly in Oracle. Seems to me Oracle makes easy things hard, and hard things impossible. I'll be looking at it closer in the next week or so and keep the list in the loop.

> I am not sure whether my comments where any useful at all, but I tried.

Thanks - I do appreciate the replies, and if you have any example code you could share, I'd appreciate having a look.

Not everything in life is spelled out. I read a quote yesterday from Thomas Edison that I think applies:
“Opportunity is missed by most people because it is dressed in overalls and looks like work.”
http://www.thomasedison.org/index.php/education/edison-quotes/ 

I need to get to work. :-)
-Tim