[jboss-user] [EJB 3.0] - Re: Transaction annotation - cannot get desired behavior

2007-05-20 Thread amitka
This will only work for EntityExistsException due to primary key constraint. The situation I encountered is with a unique constraint on other columns which are not primary keys. I used the setter methods to set some field values, and then handled both InvalidStateException to retrieve all of th

[jboss-user] [EJB 3.0] - Re: Transaction annotation - cannot get desired behavior

2007-05-20 Thread amitka
One way to solve it, from my experience, would be to inject another instance of that bean to itself, and invoke the method (the one annotated with REQUIRES_NEW) on that injected bean. Otherwise the transaction attributes annotations have no effect because you're not working with the proxy but wi

[jboss-user] [EJB 3.0] - Re: Singleton Message Driven Bean

2007-03-05 Thread amitka
You can use @PoolClass(value = org.jboss.ejb3.StrictMaxPool.class, maxSize = 1) on the MDB. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025039#4025039 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025039 __

[jboss-user] [Messaging, JMS & JBossMQ] - Re: Singleton MDB being run in two threads

2007-03-05 Thread amitka
You can use @PoolClass(value = org.jboss.ejb3.StrictMaxPool.class, maxSize = 1) on the MDB View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025038#4025038 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025038 ___

[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: inconsistent exception handling in hibernate validation

2006-12-23 Thread amitka
I just saw that when it is not an entity creation but rather it is an update on an existing entity, I'm consistently getting the InvalidStateException inside a PersistenceException which is inside a JBossRollba... which is inside a RuntimeException. This is very inconvenient. Is it possible to

[jboss-user] [Security & JAAS/JBoss] - JAAS, ejb and httpsession - login every request?

2006-12-18 Thread amitka
There are a few articles about using JAAS authentication and propagating the authenticated subject to EJBs. Sometime it is also described that in order to keep the client authenticated for the duration of HttpSession, one should keep the credentials (username + password) in the session so that e

[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: inconsistent exception handling in hibernate validation

2006-12-15 Thread amitka
I forgot to mention that JBoss doesn't wrap the InvalidStateException in EJBException because I marked this exception as an application exception, and as one that requires rollback in ejb-jar.xml the following way: | org.hibernate.validator.InvalidStateException | true | | V

[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - inconsistent exception handling in hibernate validation

2006-12-15 Thread amitka
I am using hibernate validation for JPA entities and ejb3 stateless session beans. When the entity has a generated value id, the InvalidStateException is itself thrown to the ejb client (a servlet in my case). However, when the entity's id isn't annotated with @GeneratedValue, the InvalidStateE

[jboss-user] [EJB/JBoss] - Re: Transaction demarcation ignored in stateless EJB using i

2006-12-13 Thread amitka
Problem solved. MySQL's MyISAM storage engine doesn't support transactions at all. I used Hibernate to automatically generate my schema, so it used MyISAM since it is the default. I Added the following line in my.ini file inside MySQL installation to set the default to be InnoDB, and it solved

[jboss-user] [EJB/JBoss] - Transaction demarcation ignored in stateless EJB using injec

2006-12-06 Thread amitka
Hi, I'm using EJB3 stateless beans and entities defined in the persistence API with Hibernate validation annotations, all running in the same instance of JBoss 4.0.5 in the same EAR file. I have a stateless EJB with an injected EntityManager instance variable. Methods in this bean use this enti