Okay I can get with the author of the customized code generator for more 
specifics but I believe that just adds a bit of functionality on top of 
standard JOOQ generated code.  I understand the plugin itself is from JOOQ.

Specifically it is just using the standard JOOQ Configuration class and all 
the DAOs extend from DAOImpl which too is standard JOOQ.

So for those two classes how should things be structured so that we never 
loose DB connection? E.g. what is the lifecycle of those classes/instances?

Currently we are assuming we can create any number of DefaultConfiguration 
instances and they each last indefinitely and we can use those instances in 
any number of DAOs which also last indefinitely. However is that correct? 
E.g. we are not expecting any lifecycle/termination of either objects. 
However perhaps that is not the case or we need more than a 
DefaultConfiguration?   Also should our DefaultConfiguration instance be a 
Singleton?  Currently it is not.  Also are there any DB connection pools we 
need to be concerned with?

We are just looking for guidance on how to bootstrap JOOQ's DB 
configuration with DAOImpl instances.  Are there code examples of this?

Thanks,
-Dave

On Thursday, May 3, 2018 at 3:06:35 AM UTC-6, Lukas Eder wrote:
>
> Thanks for your message,
>
> I must admit, I'm not too well acquainted with Vertx, nor with this 
> particular third-party plugin. Perhaps, you could try to get some support 
> from the maintainer of the plugin?
>
> Thanks,
> Lukas
>
> 2018-05-02 19:06 GMT+02:00 David Hoffer <[email protected] <javascript:>>:
>
>> I should have mentioned that we use this generator in the Maven plugin: 
>> io.github.jklingsporn.vertx.jooq.generate.future.FutureVertxGenerator
>>
>>
>> On Wednesday, May 2, 2018 at 11:01:47 AM UTC-6, David Hoffer wrote:
>>>
>>> We are using jooq-codegen-maven to generate all the DB pojos/daos/etc 
>>> for our DB and that works great (Postgress is our DB). The question is now 
>>> to now best/properly use those in a vertx application.
>>>
>>> Since all the DAOs require a Configuration parameter I simply created 
>>> that via DefaultConfiguration configured with connection parameters to our 
>>> DB. I'm not setting anything except the SQLDialect and the DB connection 
>>> parameters.  We also set the Vertx instance on each DAO before use.
>>>
>>> Then we create DAOs in our vertx verticles tending to reuse DAO 
>>> instances as much as possible/practical. Our code assumes that both the 
>>> Configuration (which was set in the DAO) and DAO instances are valid as 
>>> long as needed.  E.g. Configuration & DAO instances are generally created 
>>> once per handler (where a handler handles a set of vertx routes).
>>>
>>> However we are now seeing that in some cases we are getting SQL errors 
>>> that say 'This connection has been closed'.   The app will work find for 
>>> some time then we get these errors and have to restart the app to resolve.
>>>
>>> So my question is what am I doing wrong? What is the best way to 
>>> configure things so that we never get SQL connection issues?
>>>
>>> Also I'm not doing anything with transactions yet but I would like to 
>>> know how to add that if we need to in the future.
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to