[JBoss-user] [EJB 3.0] - Re: JBoss 4.0.3 - EJB 3.0 - Exception caused by UNIQUE const

2006-01-19 Thread laboratory
solved adding (rollback=true) to ApplicationException tnx anyway ;)

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3918371#3918371

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3918371


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: JBoss 4.0.3 - EJB 3.0 - Exception caused by UNIQUE const

2006-01-19 Thread laboratory
can't fix this problem, am i doing something wrong?

My Exception:

  | @ApplicationException
  | public class CreateAccountException extends Exception {
  | 
  | public CreateAccountException(String message) {
  | super(message);
  | }
  | }
  | 

My Entity Field:

  | @Column(name="USERNAME", unique=true)
  | public String getUsername() {
  | return username;
  | }
  | public void setUsername(String username) {
  | this.username = username;
  | }
  | 

My SLSB Method:

  | public void addAccount(String username, String password) throws 
CreateAccountException {
  | Account account = new Account();
  | account.setUsername(username);
  | account.setPassword(password);
  | try {
  | entityManager.persist(account);
  | entityManager.flush();
  | } catch(ConstraintViolationException e) {
  | throw new CreateAccountException("[+]ERROR CREATING 
ACCOUNT");
  | }
  | }
  | 

My Servlet Method:

  | protected void doPost(HttpServletRequest req, HttpServletResponse resp)
  | throws ServletException, IOException {
  | accountsManager.sayHello();
  | try {
  | accountsManager.addAccount("a","b");
  | accountsManager.addAccount("a","b");
  | } catch (CreateAccountException e) {
  | System.err.println(e.getMessage());
  | }
  | }
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3918369#3918369

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3918369


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: uniqueconstraint in ejb3.0

2006-01-18 Thread laboratory
same problem here! noone can solve this? i hope in a eary answer tnx ;)

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3918162#3918162

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3918162


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user