Hello. Is it possible to obtain the JNDI name of the datasource an Entity Bean is mapped to? For example if I deploy a set of Entity EJB's against datasource "java/SomeDS", is it possible to obtain the JNDI name ("java/SomeDS") programmatically within the Entity Bean's ejbCreate()?
I would like to dynamically get a connection to a datasource so I can retrieve a sequence number for generating an ID when creating a new entity in the database.
Any suggestions?
Not automatically. You can use a env ref to the datasource but you would have to set the up your self.