Thanks for the reply!!!!
In my case, I have 20 DataMaps (CopyOnWriteArrayList), each datamap being populated with data parallely. Each datamap has a dedicated thread, which is triggered first time data is written to this datamap and then repeats the process till the datamap is empty.
On each notification, thread takes the data from CopyOnWriteArrayList, on basis of some business logic and then gets the connection by looking up the datasource ( using JNDI namespace). It then looks up the EJBs to perform the rest of the business logic, but here the same connection opened at the DataMap is used by the EJB to perform the DB writes.