Sorry -- my FUBAR -- overlooked the bit about the DAO pattern because I was
looking at a reply to the message and not the message itself. I would still
tend to use Session Beans for the following reasons;

1> (actually this is unrelated to the Session Beans) Utilise a database
Factory class which in this case returns the database connection out of the
EJB container's database pool via JNDI lookup. Simplifiying database
connection management considerably.

2> If you implement Session Beans now, it will make it easier to migrate the
DAOs later should this prove necessary.

3> Just to get the transactional boundaries anyway, saves you having to
manually write code to get the transactions, even if these are incredibly
simple in nature. Black box last moments; "Did the 'flaps down' transaction
update correctly? Oh no here's a SQLException! rollback! rollback! rollback!
Oh, shi<application hits side of mountain>".

On the other hand, maybe for an inexperienced developer writing a session
bean just for simple transaction control is unnecessary complexity, like
trying to land your jumbo jet on a swamp. I won't write the black box last
moments for that one.

regs
scot.

> > First Session EJBs are usually used to implement the 'Facade
> > Pattern'. This is definitely A Good Idea. Plain old java
> > objects will not have access to the declarative transactions
> > of the EJB container, therefore even if you used POJOs to
> > facade your calls to the Entities, each and every call to
> > each individual entity method is a separate transaction.
> >
>
> The original poster just stated that they're using 'DAO pattern', which
> sounds like they're *probably* not using Entity beans. *If* this is the
> case, it may mean your arguments about multiple EJB calls don't apply.
> Israel, are you using Entity EJBs or not?
>
> If the system is simple, then transactions may not be required; it may
> be enough just to handle the commit / rollback on each JDBC call in the
> DAO. It depends on the system requirements.
>
> <snip/>
>
> > It is my opinion that non-use of the Facade Pattern is the
> > number one cause of performance problems in EJB systems.
>
> Again, it sounds like the original poster was debating whether to use
> [session EJB -> DAO object] versus [POJO -> DAO object]; if so, then the
> above isn't relevant.
>
> If the system is more complex & requires transaction support, then I
> entirely agree with your approach.


---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to