Hello, I have a question about the use of jndi. Is it made only to e.g. lookup of beans , can we compare it to the windows registry ? ->as in : its there, it works but its not good programmoing to go and use it extensively. or is it frequently used as a place to store "global" objects in memory ? I'm actually looking for a solution to cach data in a way that it has the same benefits of a entity bean (everyone can access the same data) but I don't want to make it persistent. Our first solution was to put it in an entity bean as non persistent data, but then when the bean passivates, you lose your non persistent data What can a person put in jndi and is still good programming ? thnx
Hello Maulin, So...can we use it for anything ? if so, can you give an example ? or is it just to put and search our beans in ?
Joined: Nov 04, 2001
Hi Mark, Well, it can be used to store anything but that anything is restricted to what "directory services" defines Google on directory server/services and see what they usually do. They usually store information about resources within an organization like Users, Printers etc in a central place. What you seem to refer is "caching of objects". If you mean you want to cache number of objects via JNDI (storing it in directory service), that can't be done. We should not get confused between totally different concepts here. I guess googling on "naming and directory" service or Sun's JNDI tutorial would help you identify what I am babbling.... Thanks Maulin
thnx for your reply Maulin, I read a bit about naming and directory services, its sort of a phonebook with name and an object reference 'lines' in it right ? So in this example... // Create the object to be bound Fruit fruit = new Fruit("lemon"); // Perform the bind ctx.rebind("favorite", fruit); If fruit goes out of scope, will it be deleted ? or will it stay to exist because jndi still points to it ? My guess is it will be deleted and your reference will be invalid. Or am I still missing the ball completely wrong..
thats an interesting sentence :roll: But then, is there a way (or a solution/pattern) to have an entity bean with none persistent data (for speed reasons) that everyone can access and that doesn't lose its data on passivation ? something like a stateful session bean with multiple users ? grtz Mark