Question about spec: why in EJBObject doesn't exists function getConnection? There would be no problems to access it with portable way.
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.
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!