This content has been marked as final.
Show 2 replies
-
1. Re: getiing Datasource/Connection in Session/Entity (beforeC
adrian.brock Mar 21, 2005 2:17 PM (in response to tbech)"tbech" wrote:
Question about spec: why in EJBObject doesn't exists function getConnection? There would be no problems to access it with portable way.
Thanks,
Tom
EJBObject is a proxy to the EJB. It certainly should not expose anything beyond
the interface you define as the home or business interface.
Exposing connections to clients is an anti-pattern, see the FAQ. -
2. Re: getiing Datasource/Connection in Session/Entity (beforeC
tbech Mar 23, 2005 10:39 AM (in response to tbech)In fact I was thinking of EntityBean (instead of EJBObject) and only connection in the server layers, never to the client of course.
There is often a need to have the connection (in server side layers) to do some queries (fast line reader design pattern) or huge-updates. And currently I don't see any good way of taking the connection - for me getting datasource by pointing/hardcoding datasource name is anti-pattern!