Search Results

Search found 3 results on 1 pages for 'hallidave'.

Page 1/1 | 1 

  • Elegantly handling constraint violations in EJB/JPA environment?

    - by hallidave
    I'm working with EJB and JPA on a Glassfish v3 app server. I have an Entity class where I'm forcing one of the fields to be unique with a @Column annotation. @Entity public class MyEntity implements Serializable { private String uniqueName; public MyEntity() { } @Column(unique = true, nullable = false) public String getUniqueName() { return uniqueName; } public void setUniqueName(String uniqueName) { this.uniqueName = uniqueName; } } When I try to persist an object with this field set to a non-unique value I get an exception (as expected) when the transaction managed by the EJB container commits. I have two problems I'd like to solve: 1) The exception I get is the unhelpful "javax.ejb.EJBException: Transaction aborted". If I recursively call getCause() enough times, I eventually reach the more useful "java.sql.SQLIntegrityConstraintViolationException", but this exception is part of the EclipseLink implementation and I'm not really comfortable relying on it's existence. Is there a better way to get detailed error information with JPA? 2) The EJB container insists on logging this error even though I catch it and handle it. Is there a better way to handle this error which will stop Glassfish from cluttering up my logs with useless exception information? Thanks.

    Read the article

  • Retrieving Large Lists of Objects Using Java EE

    - by hallidave
    Is there a generally-accepted way to return a large list of objects using Java EE? For example, if you had a database ResultSet that had millions of objects how would you return those objects to a (remote) client application? Another example -- that is closer to what I'm actually doing -- would be to aggregate data from hundreds of sources, normalize it, and incrementally transfer it to a client system as a single "list". Since all the data cannot fit in memory, I was thinking that a combination of a stateful SessionBean and some sort of custom Iterator that called back to the server would do the trick. How have you successfully solved this problem in the past?

    Read the article

  • What type of git server do you use? or how do you use git?

    - by Johan
    Hi Let's say we have a small team, 1-5 persons. What type of "git setup" would you use? Would you use gitweb and apache so you could run over http? Or would you use the user-accounts and ssh in some way? Today I'm familiar to use SubVersion thou apache (http), but I'm not sure it is right to setup to use git the same way... Thanks Johan Update: It feels like if we combine the answer that Dietrich Epp and the one hallidave gave I could get a quick and good solution. A common dir in the servers filesystem where all can write, and that dir is also exposed with apache. That way everybody can always get the latest, but only trusted people can write to it...

    Read the article

1