[JBoss-user] Re: Unique constraint problem

2001-06-19 Thread Bob Mancarella



Here is the 
bean code. I would expect the nonunique error to be caught by the SQLException 
catch clause but it isn't. 
 
public UserMasterPK ejbCreate(String name,String 
email,String pw,String administrator,String defaultUser,String defaultResponse) 
throws CreateException,RemoteException {  this.id = 
AutoNumberFactory.getNextNumber("user_master");  this.name=name;  this.email=email;  this.pw=pw;  this.administrator=administrator;  this.defaultUser=defaultUser;  this.defaultResponse=defaultResponse;
 
  final String STATEMENT = "INSERT INTO 
user_master (id, name, email, pw, administrator, default_user, default_response) 
VALUES (?,?,?,?,?,?,?)";  Connection conn = 
null;  PreparedStatement ps = null;
 
  try  {   conn = 
SQLUtil.getConnection(datasource);   ps = 
conn.prepareStatement(STATEMENT);   ps.setInt(1, 
id);   ps.setString(2, 
name);   ps.setString(3, 
email);   ps.setString(4, 
pw);   ps.setString(5, 
administrator);   ps.setString(6, 
defaultUser);   ps.setString(7, 
defaultResponse);   if(ps.executeUpdate()!=1)   {throw 
new CreateException("user_master ejbCreate 
failed");   }  }  catch(SQLException 
x)  {   throw new 
EJBException(x);  }  catch(NamingException 
x)  {   throw new 
EJBException(x);  }  finally  {   if(ps 
!= null)try {ps.close();} catch(Exception e) 
{}   if(conn != null)try 
{conn.close();} catch(SQLException e) 
{}  }  UserMasterPK pk = new 
UserMasterPK(id);  return pk;
 
    }


[JBoss-user] Unique constraint problem

2001-06-18 Thread Bob Mancarella



I am using Interbase with a BMP bean. If I have a column with a 
uniqueconstraint and attempt to add another row with the same value I don't 
get aSQLException. JBoss seems to throw some internal errors which I am 
unable tocatch. The output is below. 

 
Has anyone had any luck with unique 
constraints errors in JBoss?
 
-Bob
[com.faq.ejb.UserMasterHome] TRANSACTION ROLLBACK EXCEPTION:null; 
nestedexception is:    
javax.ejb.EJBException[com.faq.ejb.UserMasterHome] 
java.lang.ClassCastException:java.lang.VerifyError[com.faq.ejb.UserMasterHome]    
atorg.jboss.ejb.plugins.BMPPersistenceManager.createEntity(BMPPersistenceManager.java:151)[com.faq.ejb.UserMasterHome]    
atorg.jboss.ejb.EntityContainer.createHome(EntityContainer.java:441)[com.faq.ejb.UserMasterHome]    
at java.lang.reflect.Method.invoke(NativeMethod)


[JBoss-user] cocoon + jetty

2001-04-19 Thread Bob Mancarella
Title: cocoon + jetty





I have followed the instructions posted here to get cocoon working with jboss/jetty. It works as specified.


My question is if I want to have the xml/xsl files in the ear file how do I do the configuration.


-Bob