roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r514535 - /incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java
Date Mon, 05 Mar 2007 03:32:54 GMT
Author: bayard
Date: Sun Mar  4 19:32:54 2007
New Revision: 514535

URL: http://svn.apache.org/viewvc?view=rev&rev=514535
Log:
The timeleased column is an int (both in the db and in the hibernate config) but this class
was treating them as a String. This was causing an error on Postgres (ERROR: column timeleased
is of type integer but expression is of type character varying)

Modified:
    incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java

Modified: incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java?view=diff&rev=514535&r1=514534&r2=514535
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java
Sun Mar  4 19:32:54 2007
@@ -98,7 +98,7 @@
                     "and :leaseends < current_timestamp()";
             Query query = session.createQuery(queryHQL);
             query.setString("client", task.getClientId());
-            query.setString("timeleased", ""+task.getLeaseTime());
+            query.setInteger("timeleased", task.getLeaseTime());
             query.setString("name", task.getName());
             query.setTimestamp("timeacquired", taskLock.getTimeAquired());
             query.setTimestamp("leaseends", new Date(leaseExpireTime));
@@ -145,7 +145,7 @@
             String queryHQL = "update TaskLockData set timeLeased=:interval "+
                     "where name=:name and client=:client";
             Query query = session.createQuery(queryHQL);
-            query.setString("interval", ""+task.getInterval());
+            query.setInteger("interval", task.getInterval());
             query.setString("name", task.getName());
             query.setString("client", task.getClientId());
             int result = query.executeUpdate();



Mime
View raw message