I broke my app (PSQLException)

24 views
Skip to first unread message

Andrzej Skalski

unread,
Jun 1, 2015, 10:34:20 AM6/1/15
to lif...@googlegroups.com
Hi,

I recently reinstalled my system (Ubuntu 14.04) and therefore also reinstalled the local database system (Postgresql 9.3, default source).

Now I face a following error whenever I try to display my application (working locally):

2015-06-01 16:29:29,529 [qtp122883338-23] ERROR
net
.liftweb.http.LiftRules - Exception being returned to browser when
processing
/
org
.postgresql.util.PSQLException: This connection has been closed.
    at org
.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:843)
    at org
.postgresql.jdbc2.AbstractJdbc2Connection.getAutoCommit(AbstractJdbc2Connection.java:804)
    at org
.squeryl.dsl.QueryDsl$class._executeTransactionWithin(QueryDsl.scala:109)
    at org
.squeryl.dsl.QueryDsl$class.inTransaction(QueryDsl.scala:100)
    at net
.liftweb.squerylrecord.RecordTypeMode$.inTransaction(RecordTypeMode.scala:34)
    at bootstrap
.liftweb.Boot$$anon$1.apply(Boot.scala:121)
    at net
.liftweb.http.S$class.net$liftweb$http$S$$doAround(S.scala:1400)
    at net
.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1.apply(S.scala:1633)
    at net
.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
    at net
.liftweb.http.S$class.net$liftweb$http$S$$_nest2InnerInit(S.scala:1632)
   
 at
net
.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$41$$anonfun$apply$42$$anonfun$apply$43$$anonfun$apply$44.apply(S.scala:1676)
    at net
.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
    at net
.liftweb.http.S$$anonfun$withReq$1.apply(S.scala:1686)
    at net
.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
    at net
.liftweb.http.S$class.withReq(S.scala:1685)
    at net
.liftweb.http.S$.withReq(S.scala:47)
   
 at
net
.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$41$$anonfun$apply$42$$anonfun$apply$43.apply(S.scala:1672)
    at net
.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
    at net
.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$41$$anonfun$apply$42.apply(S.scala:1670)
    at net
.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
    at net
.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun$apply$41.apply(S.scala:1669)



the     at bootstrap.liftweb.Boot$$anon$1.apply(Boot.scala:121) is (as in most examples):

S.addAround(new LoanWrapper {
 
override def apply[T](f: => T): T = {
   
val result = inTransaction { //<here is the line 122

     
//SQL LOGGING HERE
      //Session.currentSession.setLogger(s => logger.info(s))

      try {
       
Right(f)
     
} catch {
       
case e: LiftFlowOfControlException => Left(e)
     
}
   
}

    result
match {
     
case Right(r) => r
     
case Left(exception) => throw exception
   
}
 
}
})

I tried to force Postgres to give me some details on why connection gets closed, but with no luck.

I use java 1.8 and scala 2.11.4, but that hasn't change between reinstalls. It must be some database issue (I guess).

Have anybody faced similar problems?

Andrzej

Vasya Novikov

unread,
Jun 11, 2015, 8:55:14 AM6/11/15
to lif...@googlegroups.com, andrzej....@gmail.com
Sorry for the late reply, but maybe you should just restart the
application? Or use maybe also use a thread pool.
--
Vasya Novikov
Reply all
Reply to author
Forward
0 new messages