TransactionException, SQLException: This connection has been closed

1,008 views
Skip to first unread message
Assigned to lorenzo...@geosolutionsgroup.com by me

Stefan Overkamp

unread,
Jun 19, 2023, 4:15:50 AM6/19/23
to mapstore-developers
Hi all,

sometimes trying to open a mapstore map I get no map but instead an
internal server error:

Could not roll back JPA transaction; nested exception is
org.hibernate.TransactionException: Unable to rollback against JDBC
Connection
Exception
org.springframework.transaction.TransactionSystemException: Could not
roll back JPA transaction; nested exception is
org.hibernate.TransactionException: Unable to rollback against JDBC
Connection
...
org.hibernate.TransactionException: Unable to rollback against JDBC
Connection
...
org.postgresql.util.PSQLException: This connection has been closed.

How can I get more information on this problem.
I tried to enhance postgresql logging, but there is nothing shown in the
logs.

How to configure mapstore backend to get more information or enhance
postgresql settings not to close the connection.
Im running mapstore in docker.

Thanks

Stefan

--

Stefan Overkamp
over...@posteo.de
fullstacktrace.txt

Lorenzo Natali

unread,
Jun 19, 2023, 10:43:17 AM6/19/23
to mapstore-developers
Hi,
It looks like your database server closes the connections, maybe to clean up resources.

I never experienced this issue before, anyway you can configure the GeoStore source to handle a connection pool. 
The properties are documented here:

Probably setting the testOnBorrow, testWhileIdle and other setting helps you to automatically keep alive connections or avoid to have this error, but you should try them.

I think you can configure the connections settings by this way in the geostore-datasource-ovr.properties:

geostoreDataSource.maxActive=20
geostoreDataSource.maxIdle=20
geostoreDataSource.minIdle=5
geostoreDataSource.testOnBorrow=true
geostoreDataSource.testWhileIdle=true
geostoreDataSource.maxWait=10000
geostoreDataSource.timeBetweenEvictionRunsMillis=60000


Please let us know if you found a solution that solved the problem, to help also other users with the same issue.

Thank you in advance. 

Stefan Overkamp

unread,
Jun 20, 2023, 4:15:52 AM6/20/23
to mapstore-...@googlegroups.com, Lorenzo Natali
Many, many thanks Lorenzo,

I have added this configuration and will look if the problem shows up again in the next days.
Will report again.

Stefan
--
You received this message because you are subscribed to the Google Groups "mapstore-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-develo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mapstore-developers/848b2983-b135-40e2-99d4-cf1312341784n%40googlegroups.com.


-- 
Dipl. Ing. Stefan Overkamp
over...@posteo.de
https://mapstore.geodaten-velbert.de
Reply all
Reply to author
Forward
0 new messages