users@glassfish.java.net

stateless session bean accessing helper class

From: <glassfish_at_javadesktop.org>
Date: Thu, 25 Oct 2007 20:33:08 PDT

Hi ALl

I have a helper class that I want my stateless session beans to access.
I am a bit confusedon this part and need some assistance its liket his my stateless session bean calls a helper class that is a singleton to download a file and return it and then the session bean parses the file and inserts into the DB.Now it is possible that the same helper class may be triggered more than once by two beans and if that happens two beans will try to retrieve and create the same table (for which I have now added a timeestamp so don't care) but anyways if they had the same name the two beans would overwrite each other and I may at some point have a corrupted file.. to process.. A collegeue of mine believes that since this helper is called from a thread safe context so the downloads are also thread safe ..I would like to understand exactly what happens cuold someone help me out
CHeers
Subu


so in code
@Stateless
public ProcessBean implements ProcessLocal

public void downloadANdInsert()
{
File f=TestSingleton.getInstance().downloadFile();
//then insert into db;
}
[Message sent by forum member 'priyasubu' (priyasubu)]

http://forums.java.net/jive/thread.jspa?messageID=242262