You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Martin Monperrus (JIRA)" <ji...@apache.org> on 2010/09/28 15:26:33 UTC
[jira] Created: (DERBY-4822) [patch] DropSchemaConstantAction:
could reuse the current connection provided by the available activation
object
[patch] DropSchemaConstantAction: could reuse the current connection provided by the available activation object
----------------------------------------------------------------------------------------------------------------
Key: DERBY-4822
URL: https://issues.apache.org/jira/browse/DERBY-4822
Project: Derby
Issue Type: Improvement
Components: Network Server
Reporter: Martin Monperrus
Priority: Minor
In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.
Regards, --Martin
Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
===================================================================
--- java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
+++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
@@ -27,6 +27,7 @@
import org.apache.derby.iapi.sql.dictionary.DataDictionary;
import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
import org.apache.derby.iapi.sql.execute.ConstantAction;
+import org.apache.derby.iapi.store.access.TransactionController;
/**
* This class describes actions that are ALWAYS performed for a
@@ -82,6 +83,7 @@
{
LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
DataDictionary dd = lcc.getDataDictionary();
+ TransactionController tc = lcc.getTransactionExecute();
/*
** Inform the data dictionary that we are about to write to it.
@@ -94,7 +96,7 @@
*/
dd.startWriting(lcc);
- SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
+ SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
sd.drop(lcc, activation);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-4822) DropSchemaConstantAction: could reuse
the current connection provided by the available activation object
Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rick Hillegas updated DERBY-4822:
---------------------------------
Summary: DropSchemaConstantAction: could reuse the current connection provided by the available activation object (was: [patch] DropSchemaConstantAction: could reuse the current connection provided by the available activation object)
Removing the [patch] tag from the issue description. When those square brackets turn up in the release notes they will confuse the Forrest tool which creates a download page from our release notes.
> DropSchemaConstantAction: could reuse the current connection provided by the available activation object
> --------------------------------------------------------------------------------------------------------
>
> Key: DERBY-4822
> URL: https://issues.apache.org/jira/browse/DERBY-4822
> Project: Derby
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 10.7.1.0
> Reporter: Martin Monperrus
> Assignee: Kristian Waagan
> Priority: Minor
> Fix For: 10.7.1.0
>
> Attachments: patch.txt
>
>
> In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.
> Regards, --Martin
> Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
> ===================================================================
> --- java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
> +++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
> @@ -27,6 +27,7 @@
> import org.apache.derby.iapi.sql.dictionary.DataDictionary;
> import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
> import org.apache.derby.iapi.sql.execute.ConstantAction;
> +import org.apache.derby.iapi.store.access.TransactionController;
>
> /**
> * This class describes actions that are ALWAYS performed for a
> @@ -82,6 +83,7 @@
> {
> LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
> DataDictionary dd = lcc.getDataDictionary();
> + TransactionController tc = lcc.getTransactionExecute();
>
> /*
> ** Inform the data dictionary that we are about to write to it.
> @@ -94,7 +96,7 @@
> */
> dd.startWriting(lcc);
>
> - SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
> + SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
>
> sd.drop(lcc, activation);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-4822) [patch] DropSchemaConstantAction:
could reuse the current connection provided by the available activation
object
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan updated DERBY-4822:
-----------------------------------
Component/s: (was: Network Server)
SQL
Issue & fix info: [Newcomer] (was: [Patch Available, Newcomer])
Affects Version/s: 10.7.0.0
Fix Version/s: 10.7.0.0
Assignee: Kristian Waagan
I committed the patch to trunk with revision 1023824.
Thanks for providing the patch, Martin :)
> [patch] DropSchemaConstantAction: could reuse the current connection provided by the available activation object
> ----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-4822
> URL: https://issues.apache.org/jira/browse/DERBY-4822
> Project: Derby
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 10.7.0.0
> Reporter: Martin Monperrus
> Assignee: Kristian Waagan
> Priority: Minor
> Fix For: 10.7.0.0
>
> Attachments: patch.txt
>
>
> In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.
> Regards, --Martin
> Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
> ===================================================================
> --- java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
> +++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
> @@ -27,6 +27,7 @@
> import org.apache.derby.iapi.sql.dictionary.DataDictionary;
> import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
> import org.apache.derby.iapi.sql.execute.ConstantAction;
> +import org.apache.derby.iapi.store.access.TransactionController;
>
> /**
> * This class describes actions that are ALWAYS performed for a
> @@ -82,6 +83,7 @@
> {
> LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
> DataDictionary dd = lcc.getDataDictionary();
> + TransactionController tc = lcc.getTransactionExecute();
>
> /*
> ** Inform the data dictionary that we are about to write to it.
> @@ -94,7 +96,7 @@
> */
> dd.startWriting(lcc);
>
> - SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
> + SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
>
> sd.drop(lcc, activation);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-4822) [patch] DropSchemaConstantAction:
could reuse the current connection provided by the available activation
object
Posted by "Martin Monperrus (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918476#action_12918476 ]
Martin Monperrus commented on DERBY-4822:
-----------------------------------------
Hi Kristian,
Regarding the API and DERBY-2490, I noticed in DataDictionaryImpl that:
* some methods require a TransactionController as parameter
* others use the internal methods getTransactionExecute(), getTransactionCompile() which both use getLCC() internally
In which case could it be harmful/less efficient to use the default transaction controller provided by getLCC() instead of using the one passed as parameter (if present)?
Best regards,
--Martin
> [patch] DropSchemaConstantAction: could reuse the current connection provided by the available activation object
> ----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-4822
> URL: https://issues.apache.org/jira/browse/DERBY-4822
> Project: Derby
> Issue Type: Improvement
> Components: Network Server
> Reporter: Martin Monperrus
> Priority: Minor
> Attachments: patch.txt
>
>
> In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.
> Regards, --Martin
> Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
> ===================================================================
> --- java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
> +++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
> @@ -27,6 +27,7 @@
> import org.apache.derby.iapi.sql.dictionary.DataDictionary;
> import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
> import org.apache.derby.iapi.sql.execute.ConstantAction;
> +import org.apache.derby.iapi.store.access.TransactionController;
>
> /**
> * This class describes actions that are ALWAYS performed for a
> @@ -82,6 +83,7 @@
> {
> LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
> DataDictionary dd = lcc.getDataDictionary();
> + TransactionController tc = lcc.getTransactionExecute();
>
> /*
> ** Inform the data dictionary that we are about to write to it.
> @@ -94,7 +96,7 @@
> */
> dd.startWriting(lcc);
>
> - SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
> + SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
>
> sd.drop(lcc, activation);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (DERBY-4822) [patch] DropSchemaConstantAction:
could reuse the current connection provided by the available activation
object
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan resolved DERBY-4822.
------------------------------------
Resolution: Fixed
> [patch] DropSchemaConstantAction: could reuse the current connection provided by the available activation object
> ----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-4822
> URL: https://issues.apache.org/jira/browse/DERBY-4822
> Project: Derby
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 10.7.0.0
> Reporter: Martin Monperrus
> Assignee: Kristian Waagan
> Priority: Minor
> Fix For: 10.7.0.0
>
> Attachments: patch.txt
>
>
> In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.
> Regards, --Martin
> Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
> ===================================================================
> --- java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
> +++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
> @@ -27,6 +27,7 @@
> import org.apache.derby.iapi.sql.dictionary.DataDictionary;
> import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
> import org.apache.derby.iapi.sql.execute.ConstantAction;
> +import org.apache.derby.iapi.store.access.TransactionController;
>
> /**
> * This class describes actions that are ALWAYS performed for a
> @@ -82,6 +83,7 @@
> {
> LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
> DataDictionary dd = lcc.getDataDictionary();
> + TransactionController tc = lcc.getTransactionExecute();
>
> /*
> ** Inform the data dictionary that we are about to write to it.
> @@ -94,7 +96,7 @@
> */
> dd.startWriting(lcc);
>
> - SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
> + SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
>
> sd.drop(lcc, activation);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-4822) [patch] DropSchemaConstantAction:
could reuse the current connection provided by the available activation
object
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12919273#action_12919273 ]
Kristian Waagan commented on DERBY-4822:
----------------------------------------
I don't think this is about efficiency, but about correctness for a few special cases - where a nested transaction has been created.
Derby might get into trouble if some of the work is performed using a nested transaction and some by the parent/main transaction. The nested transaction was introduced to be able to commit some work immediately without committing the work done by the parent transaction, or to release locks as early as possible where appropriate. I.e. typically do work with parent tx, do some (short duration) special work with nested tx, commit nested tx, continue with work using the parent tx.
In terms of code, the difference boils down to the following:
return tran;
vs
return (readOnlyNestedTransaction != null) ? readOnlyNestedTransaction : tran;
In a scenario as mentioned above, it is important that the correct transaction is being used at all times.
>From what I know about this issue, the patch looks correct - I'm +1 to commit it.
I will wait for a few more days to see if anyone with more knowledge about this pitches in.
> [patch] DropSchemaConstantAction: could reuse the current connection provided by the available activation object
> ----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-4822
> URL: https://issues.apache.org/jira/browse/DERBY-4822
> Project: Derby
> Issue Type: Improvement
> Components: Network Server
> Reporter: Martin Monperrus
> Priority: Minor
> Attachments: patch.txt
>
>
> In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.
> Regards, --Martin
> Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
> ===================================================================
> --- java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
> +++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
> @@ -27,6 +27,7 @@
> import org.apache.derby.iapi.sql.dictionary.DataDictionary;
> import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
> import org.apache.derby.iapi.sql.execute.ConstantAction;
> +import org.apache.derby.iapi.store.access.TransactionController;
>
> /**
> * This class describes actions that are ALWAYS performed for a
> @@ -82,6 +83,7 @@
> {
> LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
> DataDictionary dd = lcc.getDataDictionary();
> + TransactionController tc = lcc.getTransactionExecute();
>
> /*
> ** Inform the data dictionary that we are about to write to it.
> @@ -94,7 +96,7 @@
> */
> dd.startWriting(lcc);
>
> - SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
> + SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
>
> sd.drop(lcc, activation);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-4822) [patch] DropSchemaConstantAction:
could reuse the current connection provided by the available activation
object
Posted by "Martin Monperrus (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Monperrus updated DERBY-4822:
------------------------------------
Attachment: patch.txt
Hi Kristian,
Thanks for the answer. Here is the patch as file+license granting.
--Martin
> [patch] DropSchemaConstantAction: could reuse the current connection provided by the available activation object
> ----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-4822
> URL: https://issues.apache.org/jira/browse/DERBY-4822
> Project: Derby
> Issue Type: Improvement
> Components: Network Server
> Reporter: Martin Monperrus
> Priority: Minor
> Attachments: patch.txt
>
>
> In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.
> Regards, --Martin
> Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
> ===================================================================
> --- java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
> +++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
> @@ -27,6 +27,7 @@
> import org.apache.derby.iapi.sql.dictionary.DataDictionary;
> import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
> import org.apache.derby.iapi.sql.execute.ConstantAction;
> +import org.apache.derby.iapi.store.access.TransactionController;
>
> /**
> * This class describes actions that are ALWAYS performed for a
> @@ -82,6 +83,7 @@
> {
> LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
> DataDictionary dd = lcc.getDataDictionary();
> + TransactionController tc = lcc.getTransactionExecute();
>
> /*
> ** Inform the data dictionary that we are about to write to it.
> @@ -94,7 +96,7 @@
> */
> dd.startWriting(lcc);
>
> - SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
> + SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
>
> sd.drop(lcc, activation);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-4822) [patch] DropSchemaConstantAction:
could reuse the current connection provided by the available activation
object
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917935#action_12917935 ]
Kristian Waagan commented on DERBY-4822:
----------------------------------------
Hi Martin,
Thanks for providing the patch.
It looks correct, but it's hard to say without further investigation. I'll apply the patch and run the tests as a first check.
The potential difference introduced by the patch, is whether a nested transaction is used or not when accessing the data dictionary. This part of the API is confusing, as reported by Dan in DERBY-2490.
I'm not 100% sure if it is necessary, but it would be nice if you could attach the patch as a file and tick the box for granting the license to ASF.
Regards,
> [patch] DropSchemaConstantAction: could reuse the current connection provided by the available activation object
> ----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-4822
> URL: https://issues.apache.org/jira/browse/DERBY-4822
> Project: Derby
> Issue Type: Improvement
> Components: Network Server
> Reporter: Martin Monperrus
> Priority: Minor
>
> In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.
> Regards, --Martin
> Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
> ===================================================================
> --- java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
> +++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
> @@ -27,6 +27,7 @@
> import org.apache.derby.iapi.sql.dictionary.DataDictionary;
> import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
> import org.apache.derby.iapi.sql.execute.ConstantAction;
> +import org.apache.derby.iapi.store.access.TransactionController;
>
> /**
> * This class describes actions that are ALWAYS performed for a
> @@ -82,6 +83,7 @@
> {
> LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
> DataDictionary dd = lcc.getDataDictionary();
> + TransactionController tc = lcc.getTransactionExecute();
>
> /*
> ** Inform the data dictionary that we are about to write to it.
> @@ -94,7 +96,7 @@
> */
> dd.startWriting(lcc);
>
> - SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
> + SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
>
> sd.drop(lcc, activation);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-4822) [patch] DropSchemaConstantAction:
could reuse the current connection provided by the available activation
object
Posted by "Martin Monperrus (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Monperrus updated DERBY-4822:
------------------------------------
Hi,
Is the patch correct?
Thanks, --Martin
> [patch] DropSchemaConstantAction: could reuse the current connection provided by the available activation object
> ----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-4822
> URL: https://issues.apache.org/jira/browse/DERBY-4822
> Project: Derby
> Issue Type: Improvement
> Components: Network Server
> Reporter: Martin Monperrus
> Priority: Minor
>
> In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.
> Regards, --Martin
> Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
> ===================================================================
> --- java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
> +++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
> @@ -27,6 +27,7 @@
> import org.apache.derby.iapi.sql.dictionary.DataDictionary;
> import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
> import org.apache.derby.iapi.sql.execute.ConstantAction;
> +import org.apache.derby.iapi.store.access.TransactionController;
>
> /**
> * This class describes actions that are ALWAYS performed for a
> @@ -82,6 +83,7 @@
> {
> LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
> DataDictionary dd = lcc.getDataDictionary();
> + TransactionController tc = lcc.getTransactionExecute();
>
> /*
> ** Inform the data dictionary that we are about to write to it.
> @@ -94,7 +96,7 @@
> */
> dd.startWriting(lcc);
>
> - SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
> + SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
>
> sd.drop(lcc, activation);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-4822) [patch] DropSchemaConstantAction:
could reuse the current connection provided by the available activation
object
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918450#action_12918450 ]
Kristian Waagan commented on DERBY-4822:
----------------------------------------
derbyall and suites.All passed without failures with the patch applied.
> [patch] DropSchemaConstantAction: could reuse the current connection provided by the available activation object
> ----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-4822
> URL: https://issues.apache.org/jira/browse/DERBY-4822
> Project: Derby
> Issue Type: Improvement
> Components: Network Server
> Reporter: Martin Monperrus
> Priority: Minor
>
> In DropSchemaConstantAction.executeConstantAction, getSchemaDescriptor is called with a null parameter. Instead, one could reuse the current transaction controller directly available with "activation.getLanguageConnectionContext().getTransactionExecute()" as it's done with other subclasses of DDLConstantAction.
> Regards, --Martin
> Index: java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
> ===================================================================
> --- java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (revision 1001658)
> +++ java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java (working copy)
> @@ -27,6 +27,7 @@
> import org.apache.derby.iapi.sql.dictionary.DataDictionary;
> import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
> import org.apache.derby.iapi.sql.execute.ConstantAction;
> +import org.apache.derby.iapi.store.access.TransactionController;
>
> /**
> * This class describes actions that are ALWAYS performed for a
> @@ -82,6 +83,7 @@
> {
> LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
> DataDictionary dd = lcc.getDataDictionary();
> + TransactionController tc = lcc.getTransactionExecute();
>
> /*
> ** Inform the data dictionary that we are about to write to it.
> @@ -94,7 +96,7 @@
> */
> dd.startWriting(lcc);
>
> - SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, null, true);
> + SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true);
>
> sd.drop(lcc, activation);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.