I dont think it is JBoss thing.
i'm not common with postgresql but in oracle NEXTVAL is not rollbackable.
I mean if you increase sequence it is way to rollback it. Its DB feature.

D&D

On Mon, 26 Mar 2001 18:01:31 +0800, Ricky wrote:

>  
>  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


Darius Davidavicius
Living-Source
http://www.living-source.com/team_employee.php3?e_id=9&e_nextid=2
ICQ: 18325334



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

Reply via email to