On 27 March 2013 12:10, Ricardo Fabiano de Andrade
<[email protected]> wrote:
>
> soci really doesn't have this "is_connected" info available and we can't
> rely exclusively on exceptions to know that in a portable way across the
> different database backends.

Indeed.

> So our approach here was modifying soci at the backend level to try
> reconnecting automatically during X seconds, making the execution to throw a
> distinct message/code in case it can't do it.
> I like our solution because it doesn't change soci's public interface and
> AFAIK it also applies to connection_pool once all this logic is effective
> during statement execution (which will block a while during reconnection
> attempts).

Sounds good, could serve as basis for further discussion and work.

> It's working for the postgresql backend here, if any of you got interested I
> can provide a patch or a pull request.

If you have *any* code you are willing to share, please, do so.
My point is, even if a pull request won't be merged immediately
or even at all into SOCI codebase, it may be valuable to other users.
I believe that is a great way to support variety and custom-tailored features.
I think gitflow is also helpful here, for example if you submit pull request
with your solution and after review we decide to not to merge it into
master/develop
then I'm happy to merge it into feature/my-awesome-reconnector branch
and publish it at github.com/SOCI/soci as a sort of 'officially approved'
extension, so it also gets more visibility and may inspire new solutions.
I know it's not ideal, but I believe prototyping and variety is a great thing :)

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to