facebook

CMP field’s non-null value gets converted to null value..!??

  1. MyEclipse IDE
  2.  > 
  3. Comments
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #217320 Reply

    robinsingh
    Member

    This Query is a more lucid form of the query posted at wich was too much in detail and hard to folow up http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-4292.html
    I have learnt how to debug the servlet/jsp/ejb programs using the Debug prospective in myEclipse this morning.
    So i have a few more insights into the problem.

    this is the program flow.
    1)html page submits values,
    2) servlet receives them and processes them
    3)and calls entity beans methods wich create a table record in the backend and returns
    4)servlet shows those table values back on the html page.

    on step 3 , myServlet calls entityBean.create(var1,var2) ;

    Debugger’s Display view shows the value of var2 as non-null (it is submitted from html page) just before entityBEan.create() gets called.

    control goes into the entityBean.create() method definition
    wich just does

     public String ejbCreate(double var1, String var2) throws CreateException{
     this.var1=var1;
        this.var2=var2;
        return null;
    }
    

    Display view shows that the value of var2 is non-null at the last line of the
    ejbCreate() method.

    the moment control returns from this method , to the calling method in
    myServlet.create(); the App.,Server console displays exceptions saying.

    
    ERROR [entityBean] Could not create entity
    java.sql.SQLException: General error message from server: "Column 'var2' cannot be null"
    

    and further down the exceptions it shows the following root causes of the
    exceptions:

    
    ------ at $Proxy64.create(Unknown Source)
     at BonusServlet.doGet(BonusServlet.java:59)
    ----
    -------
    ----
    16:55:52,397 INFO  [STDOUT] javax.ejb.CreateException: Could not create entity:java.sql.SQLException: General error message from server: "Column 'socsec' cannot be null"
    


    now i dont understand why /where are the non-null values being returned from the called ejbCreate() method gets converted into the null values.
    all of a sudden .
    IS it some library error or what else…Coz there’s no way this conversion should occur logically ..???

    #217327 Reply

    Riyad Kalla
    Member

    Moving to Random Thoughts for community help (This is a EJB question)

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: CMP field’s non-null value gets converted to null value..!??

You must be logged in to post in the forum log in