[Persistence, JBoss/CMP, Hibernate, Database] - ERROR: duplicate key violates unique constraint
by vivekmk2006
Hi all,
I am trying to execute the bellow code,
private boolean isUserNameExist(){
Users users = getInstance();
String qry = "from Users where userName=:userName AND tenantId =:tenantId";
Query query = entityManager.createQuery(qry);
query.setParameter("userName",users.getUserName()).
setParameter("tenantId", users.getTenantId());
List lst =query.getResultList();
return lst.size() > 0 ? true : false;
}
but i am getting an entirely different exception like bellow.The exception is throwing at "List lst =query.getResultList(); " .
11:22:54,328 ERROR [JDBCExceptionReporter] ERROR: duplicate key violates unique constraint "ad_users_u2"
11:22:54,328 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
Can anybody can help me to fix it.
Thanks in advance
vivek
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166302#4166302
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166302
17 years, 9 months
[Beginners Corner] - Jboss performance Tunining
by maronvomra
Hi all,
I am new to this jboss world and have installed in the one of my server for application developers. Now they are complaining that I haven't tuned it for production environment & jboss server is taking huge RAM. What I did was just download the file 4.2.2.GA and untar it to a location to which I gave necessary rights to developers. How they are viewing that memory usage; is there any good monitoring tool?
Now as a system owner what Tuning can be done for making jboss run in production environment? Isn't it secured just out of the box.
Thanks in advance.
FYI, we are running two versions of java as below and System has 4GB RAM.
.../jdk1.5.0_09/bin/java -Xms1m -Xmx30m -classpath
../jdk1.6.0_06/bin/java -Djava.net.preferIPv4Stack=true -Xms10m -Xmx500m
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166293#4166293
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166293
17 years, 9 months