accessing the method present in stateless session bean


EJB design: accessing the method present in stateless session bean

  1. I deployed a bean in weblogic as stateless session bean .
    The bean is having normal get and set methods whenever i try to access the set methods the method is refered by the bean but it returns no data, Though the values are present in the table. Why is this happening ?

  2. I read this message and my first thought was read the spec, read a book on EJB or get some training. Then I thought that maybe you are using a stateless session bean with your own code in the method to access a database. If you are, check the method signature of your 'set' methods: convention has it that they normally return void, only 'get' methods tend to return anything. If you have coded return types in the set signature and nothing is happening then I don't know, unless your method is failing (or your code actually only returns null): you need to provide more information. Please tell me that my first thought wasn't correct!!


  3. a stateless session bean does not remember anything between methods. So, if you call a setter and then call a getter, the getter happens as if the setter never happens.
    I think if your DB access code is inside the getter, it will work.
    I am new to EJB, that is what I think.
    Good luck.

  4. before calling your getter method, are u sure, your setter method is called??

    since, you are using stateless session bean, every method call is a new call, so even your setter method sets the data,
    your getter method wont get it will be lost in between method calls.
    so, you have to use a stateful session bean, i guess.