Browse Source

Fixed bug arising from concurrent access to DbModelInfoService

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2434 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Dickon Field 19 years ago
parent
commit
0e21f5f184
  1. 6
      src/AddIns/Misc/SharpServerTools/OracleDbToolsProvider/Src/Forms/OracleFormsArtefactFactory.cs
  2. 1
      src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Data/DbModelInfoService.cs
  3. 17
      src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/DatabaseExplorerTreeNode.cs

6
src/AddIns/Misc/SharpServerTools/OracleDbToolsProvider/Src/Forms/OracleFormsArtefactFactory.cs

@ -59,15 +59,15 @@ namespace SharpDbTools.Oracle.Forms @@ -59,15 +59,15 @@ namespace SharpDbTools.Oracle.Forms
TreeNode objectNode = null;
switch(metadataCollectionName) {
case "Tables":
LoggingService.Debug("found table row");
//LoggingService.Debug("found table row");
objectNode = new TableTreeNode((string)dbObjectRow[1], logicalConnectionName);
break;
case "Users":
LoggingService.Debug("found users row");
//LoggingService.Debug("found users row");
objectNode = new TreeNode((string)dbObjectRow[0]);
break;
default:
LoggingService.Debug("found " + metadataCollectionName + " row");
//LoggingService.Debug("found " + metadataCollectionName + " row");
if (dbObjectRow.ItemArray.Length > 1) {
objectNode = new TreeNode((string)dbObjectRow[1]);
} else {

1
src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Data/DbModelInfoService.cs

@ -21,6 +21,7 @@ namespace SharpDbTools.Data @@ -21,6 +21,7 @@ namespace SharpDbTools.Data
/// - opening (essentially refreshing) from a database connection
/// - adding for new connection data (name, invariant name, connection string)
/// - saving to files
/// Note: it is not threadsafe
/// </summary>
public static class DbModelInfoService
{

17
src/AddIns/Misc/SharpServerTools/SharpDbTools/Src/Forms/DatabaseExplorerTreeNode.cs

@ -159,15 +159,16 @@ namespace SharpDbTools.Forms @@ -159,15 +159,16 @@ namespace SharpDbTools.Forms
// If the user has selected a TreeNode for a specific connection, and has the right
// mouse button down, then initiate a drag drop operation
DbModelInfoTreeNode infoNode = currentlySelected as DbModelInfoTreeNode;
if (infoNode != null) {
string logicalConnectionName = infoNode.LogicalConnectionName;
DbModelInfo info = DbModelInfoService.GetDbModelInfo(logicalConnectionName);
string connectionString = info.ConnectionString;
LoggingService.Debug("drag drop operation initiated for ConnectionString: " + connectionString);
if (connectionString != null) {
parent.DoDragDrop(connectionString, DragDropEffects.Copy);
}
if (infoNode == null) return;
string logicalConnectionName = infoNode.LogicalConnectionName;
DbModelInfo info = DbModelInfoService.GetDbModelInfo(logicalConnectionName);
if (info == null) return;
string connectionString = info.ConnectionString;
LoggingService.Debug("drag drop operation initiated for ConnectionString: " + connectionString);
if (connectionString != null) {
parent.DoDragDrop(connectionString, DragDropEffects.Copy);
}
}
}
}

Loading…
Cancel
Save