log « Exception « JPA Q&A





1. How can I force java Hibernate to throw exceptions instead of logging logj4 messages?    stackoverflow.com

Annoyingly, Hibernate in some cases seems to like to write a log to log4j itself. I don't want it to. I would like it to throw an exception when something goes ...

2. How to stop an Exception being logged    forum.hibernate.org

Hi, I have code that does, try { lock = new MyHBN(id, new Date()); db.save(lock); db.flush(); success = true; } catch (HibernateException hex) { The MyHBN contains a column that must be unique. If a unique violation occurs during the db.flush, the HibernateException is caught, so I can correctly handle it. but the following Error is still logged, [#|2010-03-08T13:10:32.577+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=23;_ThreadName=httpSSLWorkerThread-8080-4;|08 Mar 2010 ...

3. Hibernate Exceptions auto logging    forum.hibernate.org

4. Update SUCCESS but See Exception on Log    forum.hibernate.org

I have the followingmethod in my Session EJB: public void updateTestMe() throws Exception{ try{ TestMe tm = new TestMe(); tm.setComments("just"); // name is PK .. and defined as uid.hex SessionFactory sf = new Configuration().configure().buildSessionFactory(); Session sess = sf.openSession(); Transaction tx = sess.beginTransaction(); sess.save(tm); tx.commit(); sess.close(); } catch (Exception e){ e.printStackTrace(); } } The database table testme has 2 cols: NAME and ...

5. log messages in Exception constructors    forum.hibernate.org

I'm using Hibernate 2.1.6 and I noticed that a few of the Exception classes (specifically JDBCException.java, StaleObjectStateException.java, and LazyInitializationException.java) log error messages in their constructors. I believe this is a flawed design. It should be up to the user of a framework to catch exceptions and log messages appropriately. Every app has different requirements for logging so it's dangerous to make ...

6. Exception logging    forum.hibernate.org

I'm not trying to turn off all Hibernate logs. The error logs are a good thing. What I don't want is to have error messages spit out for an exception that I'm catching and handling (in this case, a bean copier that uses reflection, and ignores any properties not lazy-loaded by the time the session closes). If the exception bubbles to ...

7. Exception logging.    forum.hibernate.org

... INFO: building session factory Sep 9, 2006 3:19:34 PM org.hibernate.impl.SessionFactoryObjectFactory addInstance INFO: Not binding factory to JNDI, no JNDI name configured Sep 9, 2006 3:19:34 PM org.hibernate.LazyInitializationException SEVERE: illegal access to loading collection org.hibernate.LazyInitializationException: illegal access to loading collection at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:341) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) at org.hibernate.collection.AbstractPersistentCollection.readElementExistence(AbstractPersistentCollection.java:142) ...

8. DriverManagerConnectionProvider exception during logging    forum.hibernate.org

Hi everybody, I'm experiencing an error during redeployment of my webapplication with hibernate. The class DriverManagerConnectionProvider throws an exception at line 41 due to a Log4J error. This line simply uses a log: line 41: log.info("Using Hibernate built-in connection pool (not for production use!)"); My Log4J.properties has this configuration for this class: log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=info I have changed the level from info to ...

9. disabling exception log    forum.hibernate.org





10. Logging and throwing exception    forum.hibernate.org