Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » How to manage the access to a Db on an unstable connection
Re: How to manage the access to a Db on an unstable connection [message #50400 is a reply to message #50398] Tue, 16 October 2018 21:24 Go to previous messageGo to previous message
Zbych is currently offline  Zbych
Messages: 327
Registered: July 2009
Senior Member
There is no need to open/close connection every time you want to fetch some data or update the database. You simple need to handle database errors correctly. When connection is lost you should catch exception, analyse error and try to reconnect if connection is lost. Also all inserts/updates can be surrounded by begin/commit/rollback and if you loose connection postgress will automatically drop unfinished inserts/updates.
Just check functions: ConnectionOK, ReOpen and callback WhenReconnect

https://github.com/ultimatepp/mirror/blob/master/uppsrc/Post greSQL/PostgreSQL.h
 
Read Message
Read Message
Read Message
Previous Topic: [SOLVED] How to use aliases with SqlExp?
Next Topic: SQL statements timeout in Linux (bug?)
Goto Forum:
  


Current Time: Sun Jun 08 12:18:47 CEST 2025

Total time taken to generate the page: 0.04842 seconds