[
https://issues.apache.org/jira/browse/CAY-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041831#comment-13041831
]
Andrus Adamchik commented on CAY-1573:
--------------------------------------
Thanks for the patch. Having it all in one piece is a bit hard to process, so I
tried to separate into manageable pieces. I succeeded somewhat to split
somewhat unrelated 20% of the patch and made my first commit with it
(r1129909). My main edit to this part (which we may follow in the remaining
parts) is replacing lazy initialization of the logger in the getter method
with eager initialization to NoopJdbcEventLogger in constructor. This appears
to be the most safest and non-intrusive way to add logger to most classes.
In the remaining patch (aside from what git removes automatically when rebasing
against my commit), we can also remove changes to DataContext,
TransactionThreadTest, UserTransactionTest that are no longer needed with the
approach above.
The next thing I looked at is JdbcAdapter/JdbcActionBuilder/BaseSQLAction,
which seems to be the biggest (and the only?) remaining chunk. Maybe we can
also perform with NoopJdbcEventLogger setup in constructor to avoid lazy
initialization of the logger... This will give us a fully committable
QueryLogger port.
After that we may further refine it to perfection. The next pass (meaning a
separate patch), we may avoid using "setJdbcEventLogger" and use safer
constructor injection instead. This will require deeper refactoring so I don't
want that to get mixed with any unrelated things.
> QueryLogger to DI JdbcEventLogger migration
> -------------------------------------------
>
> Key: CAY-1573
> URL: https://issues.apache.org/jira/browse/CAY-1573
> Project: Cayenne
> Issue Type: Improvement
> Reporter: Dzmitry Kazimirchyk
> Priority: Minor
> Attachments: query-logger.patch, query-logger.patch
>
>
> Migration from deprecated QueryLogger to DI enabled JdbcEventLogger.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira