ok lemme give the code that generate some warnings :
public City byName(String name) throws HibernateException
{
System.out.println("Retrieving the City");
sess = sessFact.openSession();
try
{
List aList = sess.find("from City as city where lower(city.name)=lower(:name)", name,Hibernate.STRING);
if (aList.size() == 0)
{
System.out.println("No City named " + name);
return null;
}
else
{
theCity = (City) aList.get(0);
System.out.println(theCity);
System.out.println(" City is successfully retrieved");
}
}
catch(HibernateException he)
{
throw he;
}
finally
{
sess.close();
}
return theCity;
}
And this is the log :
Initializing successful
Retrieving the City
09:21:53,625 DEBUG SessionImpl:531 - opened session
09:21:53,625 DEBUG SessionImpl:1497 - find: from com.andrewtani.tm.hbm.ref.City as city where lower(city.name)=lower(:name)
09:21:53,625 DEBUG QueryParameters:105 - parameters: []
09:21:53,640 DEBUG QueryTranslator:147 - compiling query
09:21:53,671 DEBUG SessionImpl:2210 - flushing session
09:21:53,671 DEBUG SessionImpl:2403 - Flushing entities and processing referenced collections
09:21:53,671 DEBUG SessionImpl:2746 - Processing unreferenced collections
09:21:53,671 DEBUG SessionImpl:2760 - Scheduling collection removes/(re)creates/updates
09:21:53,671 DEBUG SessionImpl:2234 - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
09:21:53,687 DEBUG SessionImpl:2239 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
09:21:53,687 DEBUG SessionImpl:1782 - Dont need to execute flush
09:21:53,687 DEBUG QueryTranslator:199 - HQL: from com.andrewtani.tm.hbm.ref.City as city where lower(city.name)=lower(:name)
09:21:53,687 DEBUG QueryTranslator:200 - SQL: select city0_.ID as ID, city0_.CITY_NAME as CITY_NAME, city0_.CITY_DESCRIPTION as CITY_DES3_ from CITIES city0_ where (lower(city0_.CITY_NAME)=lower(?))
09:21:53,687 DEBUG BatcherImpl:196 - about to open: 0 open PreparedStatements, 0 open ResultSets
09:21:53,687 DEBUG SQL:237 - select city0_.ID as ID, city0_.CITY_NAME as CITY_NAME, city0_.CITY_DESCRIPTION as CITY_DES3_ from CITIES city0_ where (lower(city0_.CITY_NAME)=lower(?))
Hibernate: select city0_.ID as ID, city0_.CITY_NAME as CITY_NAME, city0_.CITY_DESCRIPTION as CITY_DES3_ from CITIES city0_ where (lower(city0_.CITY_NAME)=lower(?))
09:21:53,687 DEBUG BatcherImpl:241 - preparing statement
09:21:53,906 DEBUG Loader:197 - processing result set
09:21:53,906 DEBUG Loader:226 - done processing result set (0 rows)
09:21:53,906 DEBUG BatcherImpl:203 - done closing: 0 open PreparedStatements, 0 open ResultSets
09:21:53,921 DEBUG BatcherImpl:261 - closing statement
09:21:53,921 DEBUG Loader:239 - total objects hydrated: 0
09:21:53,921 DEBUG SessionImpl:3082 - initializing non-lazy collections
No City named
09:21:53,921 DEBUG SessionImpl:549 - closing session 09:21:53,921 DEBUG SessionImpl:3294 - disconnecting session 09:21:53,937 DEBUG JDBCExceptionReporter:18 - SQL Warning java.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to ATC at com.microsoft.jdbc.base.BaseWarnings.createSQLWarning(Unknown Source) at com.microsoft.jdbc.base.BaseWarnings.get(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.getWarnings(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.mchange.v2.c3p0.impl.C3P0PooledConnection$ProxyConnectionInvocationHandler.invoke(C3P0PooledConnection.java:645) at com.mchange.v2.c3p0.impl.$Proxy0.getWarnings(Unknown Source) at net.sf.hibernate.impl.BatcherImpl.closeConnection(BatcherImpl.java:289) at net.sf.hibernate.impl.SessionImpl.disconnect(SessionImpl.java:3310) at net.sf.hibernate.impl.SessionImpl.close(SessionImpl.java:552) at com.andrewtani.tm.hbm.query.GetCity.byName(GetCity.java:116) at com.andrewtani.tm.hbm.query.GetCity.<init>(GetCity.java:36) at com.andrewtani.tm.hbm.query.GetCity.main(GetCity.java:123) 09:21:53,953 WARN JDBCExceptionReporter:20 - SQL Warning: 0, SQLState: 09:21:53,953 WARN JDBCExceptionReporter:28 - [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to ATC 09:21:53,953 WARN JDBCExceptionReporter:20 - SQL Warning: 0, SQLState: 09:21:53,953 WARN JDBCExceptionReporter:28 - [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Changed database context to 'ATC'. 09:21:53,953 WARN JDBCExceptionReporter:20 - SQL Warning: 0, SQLState: 09:21:53,953 WARN JDBCExceptionReporter:28 - [Microsoft][SQLServer 2000 Driver for JDBC]Language changed to us_english 09:21:53,953 WARN JDBCExceptionReporter:20 - SQL Warning: 0, SQLState: 09:21:53,953 WARN JDBCExceptionReporter:28 - [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Changed language setting to us_english. 09:21:53,968 DEBUG SessionImpl:561 - transaction completion
Did I close the session correctly? is this warning has something to do with that Out of Memory error? OR is it Tapestry/Tomcat problem?
|