Hi all , I am using Linux6.1 , jBoss2.1 , Tomcat3.2.1 and jdk1.3 ,
postgresql.

  I have the code below in the stateless bean : I trying to rollback the
transaction if there are existing sequence id in the table.
  However , the method did not rollback because when i check the
sequence table , it will increment the sequence value.
  How to rollback the method below , anyone have any idea ? Thanks

  public void addProjectInfo(ProjectInfoJB projectinfojb) throws
RemoteException,
  CreateException ,FinderException,UserException {
  System.out.println(projectinfojb.getProjectno());

  if(isProjectNoExists(projectinfojb.getProjectno())){
   try{
    Connection conn = null;
    PreparedStatement ps = null;
    ResultSet rs = null;

    conn = this.getConnection() ;
    ps = conn.prepareStatement("Select NEXTVAL('userprojectinfo_seq')
from userprojectinfo_seq");
    rs = ps.executeQuery(); -- > this will execute the sql statement but
it should rollback if found same sequence id in the table

    if(rs.next()){
      projectinfojb.setProjectid(rs.getInt("nextval"));
     }
   }
   catch(Exception ce){
    ce.printStackTrace();
   }
    projectinfohome.create(projectinfojb);
   }
  }

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to