aravind kopparthi wrote:
Jai: 1) Using java.io.* in EJBs isn't recommended.
is this true for Ejb 3.1 as well?( how about Singleton EJB reading file and transforming and then calling SLSBS for persitence is this recommended?)
i was thinking of using SLSB to read file content and tranform into Entities for persirence. what is the recommend if Ejbs can not read files?
It applies for EJB3.1 as well. Check section 21.2.2 "Programming Restrictions" in EJB3.1 spec for the entire set of restrictions.
As for java.io.* restriction, here's a quote from that section.
An enterprise bean must not use the java.io package to attempt to access files and directories in the file system.
The file system APIs are not well-suited for business components to access data. Business components should use a resource manager API, such as JDBC, to store data.
You don't have to do the file reading part in the EJBs. Just let the EJBs persist your entities.