CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    11

    transaction.RollbackException + EJB

    Hi,
    I am trying to write into two tables via one method in the Session bean which References the corr. Entity Beans. However I get the transaction.RollbackExceptio.

    Here is what I am doing

    In the Session bean in one method I have

    try{
    int year = semester4.getYear();
    String semester = semester4.getSemester();
    System.out.println("Came inside .. just before isCourseAddedAdminMode");

    LocalPre_course pre_course = pre_courseHome.create(course_number, prerequisite);
    LocalCourse course = courseHome.create(call_number, course_number, semester, year, course_name,
    department, credit, prerequisite, desc, total_seats, avail_seats, f_ssn);
    }

    catch(Exception ex){
    //throw new EJBException(ex.getMessage());
    return false;
    }
    return true;
    }



    in the corr. entity beans
    //This is the pre_course bean

    public String ejbCreate(String course_number, String p_course)
    throws CreateException{

    System.out.println("Came inside Pre_CourseEntityBean.. just before isAdded");

    setCourse_number(course_number);
    setP_course(p_course);

    return null;
    }

    //this is the courseBean

    public String ejbCreate(String call_number, String course_number,String semester, int year,
    String course_name, String department,int credit, String prerequisite,
    String desc, int total_seats,int avail_seats, int f_ssn)
    throws CreateException{ //should throw more exceptions !!!!!!!

    System.out.println("Came inside CourseEntityBean.. just before isAdded");
    setCall_number(call_number);
    setCourse_number(course_number);
    setSemester(semester);
    setYear(year);
    setCourse_name(course_name);
    setDepartment(department);
    setCredit(credit);
    setPrerequisite(prerequisite);
    setDesc(desc);
    setTotal_seats(total_seats);
    setAvail_seats(avail_seats);
    setF_ssn(f_ssn);

    return null;
    }


    //screendump on server window

    Came inside .. just before isCourseAdded
    Came inside .. just before isCourseAdded (ADMINCONTROLLER!)
    Came inside .. just before isCourseAddedAdminMode
    Came inside Pre_CourseEntityBean.. just before isAdded
    Came inside CourseEntityBean.. just before isAdded
    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
    java.rmi.RemoteException: Transaction aborted (possibly due to transacti
    on time out).; nested exception is: javax.transaction.RollbackException: Transac
    tion marked for rollback; nested exception is:
    javax.transaction.RollbackException: Transaction marked for rollback
    java.rmi.RemoteException: Transaction aborted (possibly due to transaction time
    out).; nested exception is: javax.transaction.RollbackException: Transaction mar
    ked for rollback; nested exception is:
    javax.transaction.RollbackException: Transaction marked for rollback
    javax.transaction.RollbackException: Transaction marked for rollback
    <<no stack trace available>>



    I cannot figure out the problem ,,,, since the println statements works its just before or when the set methods it called in the Entity I believe

    I remain waiting eagerly for an answer

  2. #2
    Join Date
    Nov 2004
    Posts
    11

    Re: transaction.RollbackException + EJB

    I go the thing to work

    I had a wrong attribute name in the CourseBeanTable

    I had "instructor" instead of "f_ssn"

    sorry folks !! I guess I still have the drowsy effect of the Turkey last night !!

    regards!
    Samik

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured