> I'm wondering about the following implementation though:
> ...
> public Factory create() {
>         return new SQLiteFactory(getConnection());
> }
> ...
> The method creates a new factory every time it's called, (instead of reusing
> a singleton, for example) which strikes me as a bit odd. Is this by design
> or am i missing something here?

This has been an issue several times on this user group. The lifecycle
of a factory *should* match that of a transaction, but it *may* also
just match that of a query. On the other hand, it *must not* be shared
among threads / transactions / connections. It's up to you to handle
it correctly. Creating it afresh will not generate significant
overhead. But yes, in this particular case, it could be lazy
initialised and stored in the database instance.

> Currently I have a skeleton "monkey-see-monkey-do" implementation based on
> the SQLiteDatabase source code. I'm not sure how to actually test this
> though.

There are various create.sql (DDL) and reset.sql (DML) files in jOOQ's
testing module. For instance:
https://github.com/jOOQ/jOOQ/tree/master/jOOQ-test/src/org/jooq/test/sqlite

These sample databases contain all the code-generation corner cases
I've encountered so far (case-sensitivity issues, naming clashes,
etc). It would be great if generated code would contain no compilation
errors against a similar sample database.

Tell me if you need more information about the jOOQ-test module.

> Please let me know how i can send you the files if you want to take
> a look.

Ideally, as a pull request on GitHub.

Reply via email to