Wednesday, March 21, 2012

Passing connection managers to subpackages.

Is there a recommended way to pass the connection managers from the parent package to the subpackages? I also noticed that the subpackages can't reference the same configuration file as I get error messages when I try to build the solution. After I changed the configuration file for each subpackage it worked just fine. Did I miss something or is this intended to work this way?
thanks

Hi,

when you say "passing the CM's from the parent package to the subpackages", you use the ExecutePackage task or a different method?

The error with using the same configuration file is a known issue and will be addresed in a future realease

Thanks,
Ovidiu Burlacu|||I guess I'm having a difficult time understanding and even testing connection managers and configuration files. Here's what I'm trying to accomplish and am failing...

I have a project "X" with a "main" package and a another package called "child".
I have defined a generic connection manager in each of the packages (main and child ) called "SOURCEDB".

I have then created a configuration file called "connMgr". In both packages I identify this configuration file (let's just use direct configuration for now) and specify that I want the connection string, username and password configurable at load/run time.

My understanding would be that before I run the package I edit the configuration with the appropriate connection string and username so I can run the main package against different databases based on current requirements.

However, when I run the program it says that the configuration file is the same (during build) and generates an error. What is the recommended way to get around this and am I going about this the wrong way?

I have also noticed with indirect configurations that once you have to make a modification to the configuration file the file location initially specified for the configuration file is lost. Is that a bug also?

thanks
John|||1. To avoid the build error r-click the project in Solution Explorer window and choose 'Properties'. In that dialog go to 'Deployment Utility' and Set CreateDeploymentUtility to False.

If you really need deployment utility then use the XML configuration file only for the parent package and in the child package use a Parent Package variable configuration. Then in the parent package you create a variable where you can put your connection string.

2. I suggest you configure only the ConnectionString, because that will take care of User and Password as well.

3. You said "I have also noticed with indirect configurations that once you have to make a modification to the configuration file the file location initially specified for the configuration file is lost. Is that a bug also?"
Can you be more detailed in the steps that I need to follow to repro this problem?

HTH,
Ovidiu Burlacu|||Thanks for the info. I'll try answer 1. I tried using only connection string but I have noticed that the password doesn't get stored in the configuration file. When I change the connection string the job will fail the next time as the password isn't valid. How do I get the password changed and where when using the configuration file?

3. When I create an indirect configuration file I start first by creating the direct configuration which I point to a filename and directory. Once I have that created I go back and specify the env variable to use for this configuration.

Let's say I then have to make a modification to the configuration file. If I go back and uncheck the "Configuration location is stored in an environment variable" to make configuration changes I have to check the other option but the file name and directory are no longer there. I then have to go search for the configuration file location which is not too much pain for me but for someone else it could be who is administering the packages... It would be nice to retain the filename and location in that field.

thanks|||

With respect to your answer 1 I assume that's just a current workaround, correct? I assume that this is a bug and will be fixed in the near future ...

|||Yes this is a workaround, and as I specified in my first reply the bug will be addressed in a future release.

Thanks,
Ovidiu|||Do you have any thoughts on the password problem I'm having? I'm not sure if you saw the post from this morning ...
thanks|||

I tried your scenario but when I went in the XML config file and added Password=<my_password> to the ConnectionString the package executed just fine.

HTH,
Ovidiu

|||I was under the assumption it would add the password automatically. There is one slight problem with this. If you add the password manually it gets overridden the next time you regenerate the configuration file. You'll have to remember to add the password manually every time!!!|||Adding the password automatically is a security violation. (disclosure of confidential information). The user must enter the password manually, this way he will make sure that the file will get the appropiate ACL's

Thanks,
Ovidiu|||I did notice that if you use the manifest to install your packages on the server that it will automatically add the password to the config file. That would seem to contradict the above statement somewhat.|||

Can you describe the issue in more detail?

What password is saved in the config file?

Thanks,
Ovidiu

|||

If you double-click on the manifest file and go through the package installation wizard you can add the values for password and username if that's what you have checked off in the config file. It will then go ahead and add the password='password' in the configuration file.

Someone else at our company didn't specify connection string but username and password and it seems to add the password in the configuration file. However, if you use connection string it won't.

|||

This falls into what I said: "The user must enter the password manually"

If the user enters the password value in the wizard I must save that value into the configuration file because this is what the user want. Is not that we automatically save the password in the config gile.

Ovidiu

No comments:

Post a Comment