You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Jason Zheng (JIRA)" <ji...@apache.org> on 2008/04/18 23:16:21 UTC

[jira] Created: (OPENJPA-577) OpenJPA doesn't create LoggingConnectionDecorator instance if log trace is not enabled

OpenJPA doesn't create LoggingConnectionDecorator instance if log trace is not enabled
--------------------------------------------------------------------------------------

                 Key: OPENJPA-577
                 URL: https://issues.apache.org/jira/browse/OPENJPA-577
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 1.1.0
            Reporter: Jason Zheng
            Priority: Minor


In current openjpa code, a LoggingConnectionDecorator instance is created only if jdbcLog or sqlLog trace is enabled. This change was made for resolving issue http://issues.apache.org/jira/browse/OPENJPA-407.

$ svn diff -r 589723:590150 DataSourceFactory.java

Index: DataSourceFactory.java
===================================================================
--- DataSourceFactory.java      (revision 589723)
+++ DataSourceFactory.java      (revision 590150)
@@ -162,12 +162,15 @@
                     decorators.addAll(decs);
             }

-            // logging decorator
-            LoggingConnectionDecorator lcd = new LoggingConnectionDecorator();
-            Configurations.configureInstance(lcd, conf, opts);
-            lcd.getLogs().setJDBCLog(jdbcLog);
-            lcd.getLogs().setSQLLog(sqlLog);
-            decorators.add(lcd);
+            if (jdbcLog.isTraceEnabled() || sqlLog.isTraceEnabled()) {
+                // logging decorator
+                LoggingConnectionDecorator lcd =
+                    new LoggingConnectionDecorator();
+                Configurations.configureInstance(lcd, conf, opts);
+                lcd.getLogs().setJDBCLog(jdbcLog);
+                lcd.getLogs().setSQLLog(sqlLog);
+                decorators.add(lcd);
+            }

             dds.addDecorators(decorators);
             return dds;

With this change, openjpa.ConnectionFactoryProperties options ("PrettyPrint", "PrettyPrintLineLength") and kodo.ConnectionFactoryProperties("TrackParameters") won't take effect unless log trace is enabled. 

Before this change we allow tracking parameters in error reporting when logging is disabled. I believe this is a regresson, and we should revert that change. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-577) OpenJPA doesn't create LoggingConnectionDecorator instance if log trace is not enabled

Posted by "Jason Zheng (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Zheng updated OPENJPA-577:
--------------------------------

    Attachment: OPENJPA-577.patch

The attached patch reverted the change made in r590150 for DataSourceFactory.java, so openjpa will create an instance of LoggingConnectionDecorator even if the log trace is disabled.


> OpenJPA doesn't create LoggingConnectionDecorator instance if log trace is not enabled
> --------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-577
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-577
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Jason Zheng
>            Priority: Minor
>         Attachments: OPENJPA-577.patch
>
>
> In current openjpa code, a LoggingConnectionDecorator instance is created only if jdbcLog or sqlLog trace is enabled. This change was made for resolving issue http://issues.apache.org/jira/browse/OPENJPA-407.
> $ svn diff -r 589723:590150 DataSourceFactory.java
> Index: DataSourceFactory.java
> ===================================================================
> --- DataSourceFactory.java      (revision 589723)
> +++ DataSourceFactory.java      (revision 590150)
> @@ -162,12 +162,15 @@
>                      decorators.addAll(decs);
>              }
> -            // logging decorator
> -            LoggingConnectionDecorator lcd = new LoggingConnectionDecorator();
> -            Configurations.configureInstance(lcd, conf, opts);
> -            lcd.getLogs().setJDBCLog(jdbcLog);
> -            lcd.getLogs().setSQLLog(sqlLog);
> -            decorators.add(lcd);
> +            if (jdbcLog.isTraceEnabled() || sqlLog.isTraceEnabled()) {
> +                // logging decorator
> +                LoggingConnectionDecorator lcd =
> +                    new LoggingConnectionDecorator();
> +                Configurations.configureInstance(lcd, conf, opts);
> +                lcd.getLogs().setJDBCLog(jdbcLog);
> +                lcd.getLogs().setSQLLog(sqlLog);
> +                decorators.add(lcd);
> +            }
>              dds.addDecorators(decorators);
>              return dds;
> With this change, openjpa.ConnectionFactoryProperties options ("PrettyPrint", "PrettyPrintLineLength") and kodo.ConnectionFactoryProperties("TrackParameters") won't take effect unless log trace is enabled. 
> Before this change we allow tracking parameters in error reporting when logging is disabled. I believe this is a regresson, and we should revert that change. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-577) OpenJPA doesn't create LoggingConnectionDecorator instance if log trace is not enabled

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey resolved OPENJPA-577.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.0

> OpenJPA doesn't create LoggingConnectionDecorator instance if log trace is not enabled
> --------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-577
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-577
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Jason Zheng
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: OPENJPA-577.patch
>
>
> In current openjpa code, a LoggingConnectionDecorator instance is created only if jdbcLog or sqlLog trace is enabled. This change was made for resolving issue http://issues.apache.org/jira/browse/OPENJPA-407.
> $ svn diff -r 589723:590150 DataSourceFactory.java
> Index: DataSourceFactory.java
> ===================================================================
> --- DataSourceFactory.java      (revision 589723)
> +++ DataSourceFactory.java      (revision 590150)
> @@ -162,12 +162,15 @@
>                      decorators.addAll(decs);
>              }
> -            // logging decorator
> -            LoggingConnectionDecorator lcd = new LoggingConnectionDecorator();
> -            Configurations.configureInstance(lcd, conf, opts);
> -            lcd.getLogs().setJDBCLog(jdbcLog);
> -            lcd.getLogs().setSQLLog(sqlLog);
> -            decorators.add(lcd);
> +            if (jdbcLog.isTraceEnabled() || sqlLog.isTraceEnabled()) {
> +                // logging decorator
> +                LoggingConnectionDecorator lcd =
> +                    new LoggingConnectionDecorator();
> +                Configurations.configureInstance(lcd, conf, opts);
> +                lcd.getLogs().setJDBCLog(jdbcLog);
> +                lcd.getLogs().setSQLLog(sqlLog);
> +                decorators.add(lcd);
> +            }
>              dds.addDecorators(decorators);
>              return dds;
> With this change, openjpa.ConnectionFactoryProperties options ("PrettyPrint", "PrettyPrintLineLength") and kodo.ConnectionFactoryProperties("TrackParameters") won't take effect unless log trace is enabled. 
> Before this change we allow tracking parameters in error reporting when logging is disabled. I believe this is a regresson, and we should revert that change. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-577) OpenJPA doesn't create LoggingConnectionDecorator instance if log trace is not enabled

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey resolved OPENJPA-577.
-------------------------------------

    Resolution: Fixed

> OpenJPA doesn't create LoggingConnectionDecorator instance if log trace is not enabled
> --------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-577
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-577
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Jason Zheng
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: OPENJPA-577.patch
>
>
> In current openjpa code, a LoggingConnectionDecorator instance is created only if jdbcLog or sqlLog trace is enabled. This change was made for resolving issue http://issues.apache.org/jira/browse/OPENJPA-407.
> $ svn diff -r 589723:590150 DataSourceFactory.java
> Index: DataSourceFactory.java
> ===================================================================
> --- DataSourceFactory.java      (revision 589723)
> +++ DataSourceFactory.java      (revision 590150)
> @@ -162,12 +162,15 @@
>                      decorators.addAll(decs);
>              }
> -            // logging decorator
> -            LoggingConnectionDecorator lcd = new LoggingConnectionDecorator();
> -            Configurations.configureInstance(lcd, conf, opts);
> -            lcd.getLogs().setJDBCLog(jdbcLog);
> -            lcd.getLogs().setSQLLog(sqlLog);
> -            decorators.add(lcd);
> +            if (jdbcLog.isTraceEnabled() || sqlLog.isTraceEnabled()) {
> +                // logging decorator
> +                LoggingConnectionDecorator lcd =
> +                    new LoggingConnectionDecorator();
> +                Configurations.configureInstance(lcd, conf, opts);
> +                lcd.getLogs().setJDBCLog(jdbcLog);
> +                lcd.getLogs().setSQLLog(sqlLog);
> +                decorators.add(lcd);
> +            }
>              dds.addDecorators(decorators);
>              return dds;
> With this change, openjpa.ConnectionFactoryProperties options ("PrettyPrint", "PrettyPrintLineLength") and kodo.ConnectionFactoryProperties("TrackParameters") won't take effect unless log trace is enabled. 
> Before this change we allow tracking parameters in error reporting when logging is disabled. I believe this is a regresson, and we should revert that change. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (OPENJPA-577) OpenJPA doesn't create LoggingConnectionDecorator instance if log trace is not enabled

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey reopened OPENJPA-577:
-------------------------------------


Keeping open as a reminder to backport to trunk.

> OpenJPA doesn't create LoggingConnectionDecorator instance if log trace is not enabled
> --------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-577
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-577
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.1.0
>            Reporter: Jason Zheng
>            Priority: Minor
>             Fix For: 1.1.0
>
>         Attachments: OPENJPA-577.patch
>
>
> In current openjpa code, a LoggingConnectionDecorator instance is created only if jdbcLog or sqlLog trace is enabled. This change was made for resolving issue http://issues.apache.org/jira/browse/OPENJPA-407.
> $ svn diff -r 589723:590150 DataSourceFactory.java
> Index: DataSourceFactory.java
> ===================================================================
> --- DataSourceFactory.java      (revision 589723)
> +++ DataSourceFactory.java      (revision 590150)
> @@ -162,12 +162,15 @@
>                      decorators.addAll(decs);
>              }
> -            // logging decorator
> -            LoggingConnectionDecorator lcd = new LoggingConnectionDecorator();
> -            Configurations.configureInstance(lcd, conf, opts);
> -            lcd.getLogs().setJDBCLog(jdbcLog);
> -            lcd.getLogs().setSQLLog(sqlLog);
> -            decorators.add(lcd);
> +            if (jdbcLog.isTraceEnabled() || sqlLog.isTraceEnabled()) {
> +                // logging decorator
> +                LoggingConnectionDecorator lcd =
> +                    new LoggingConnectionDecorator();
> +                Configurations.configureInstance(lcd, conf, opts);
> +                lcd.getLogs().setJDBCLog(jdbcLog);
> +                lcd.getLogs().setSQLLog(sqlLog);
> +                decorators.add(lcd);
> +            }
>              dds.addDecorators(decorators);
>              return dds;
> With this change, openjpa.ConnectionFactoryProperties options ("PrettyPrint", "PrettyPrintLineLength") and kodo.ConnectionFactoryProperties("TrackParameters") won't take effect unless log trace is enabled. 
> Before this change we allow tracking parameters in error reporting when logging is disabled. I believe this is a regresson, and we should revert that change. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.