ES Server and RemoteDatasourceKey Questions


Author
Message
Richard Keller
Richard Keller
StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)
Group: Forum Members
Posts: 84, Visits: 324
Hi guys,

Let me know if this would work.  I have a single application that wants to switch databases on the ES Server side.  If I have Multiplae DataSourceConnections like the sample below, should I just be able to change the RemoteDataSourceKey in the call without any other modifactions?   Second if I'm adding ConnectionStrings does this read in real time or is it populated on the start of the server.  Basically I would need to know if the Server is caching this configure or I could add Databases on the fly.

I ask the first question because I get an error if I use the DEV2 sample otherwise the MultiShip works fine.  The second would be for administration and deployment.

Thanks,

Rich

Sample:

<?xml version="1.0" encoding="utf-8" ?>

<DataSources>
 <DataSource DataSourceKey="MultiShip">
  <ConnectionString>server=localhost;Integrated Security=SSPI;Database=RZMultiShip;</ConnectionString>
  <TypeFullName>MicroFour.StrataFrame.Data.SqlDataSourceItem</TypeFullName>
  <TypeAssemblyName>MicroFour StrataFrame Base</TypeAssemblyName>
  <TypeAssemblyVersion>1.7.0.0</TypeAssemblyVersion>
  <TypeAssemblyCulture>neutral</TypeAssemblyCulture>
  <TypeAssemblyPublicToken>99fe9917f71608a7</TypeAssemblyPublicToken>
  <IsEncrypted>True</IsEncrypted>
  <IsCompressed>True</IsCompressed>
  <EncryptionKey>151, 123, 237, 154, 69, 13, 132, 130, 233, 174, 208, 232, 85, 162, 40, 169, 161, 0, 140, 40, 47, 163, 98, 73</EncryptionKey>
  <EncryptionVector>133, 78, 229, 207, 101, 227, 102, 225</EncryptionVector>
  <TransactionTimeout>3600</TransactionTimeout>
 </DataSource>
 <DataSource DataSourceKey="">
  <ConnectionString>server=localhost;Integrated Security=SSPI;Database=RZMultiShip3;</ConnectionString>
  <TypeFullName>MicroFour.StrataFrame.Data.SqlDataSourceItem</TypeFullName>
  <TypeAssemblyName>MicroFour StrataFrame Base</TypeAssemblyName>
  <TypeAssemblyVersion>1.7.0.0</TypeAssemblyVersion>
  <TypeAssemblyCulture>neutral</TypeAssemblyCulture>
  <TypeAssemblyPublicToken>99fe9917f71608a7</TypeAssemblyPublicToken>
  <IsEncrypted>True</IsEncrypted>
  <IsCompressed>True</IsCompressed>
  <EncryptionKey>151, 123, 237, 154, 69, 13, 132, 130, 233, 174, 208, 232, 85, 162, 40, 169, 161, 0, 140, 40, 47, 163, 98, 73</EncryptionKey>
  <EncryptionVector>133, 78, 229, 207, 101, 227, 102, 225</EncryptionVector>
  <TransactionTimeout>3600</TransactionTimeout>
 </DataSource>
 <DataSource DataSourceKey="Dev2">
  <ConnectionString>server=localhost;Integrated Security=SSPI;Database=RZMultiShip2;</ConnectionString>
  <TypeFullName>MicroFour.StrataFrame.Data.SqlDataSourceItem</TypeFullName>
  <TypeAssemblyName>MicroFour StrataFrame Base</TypeAssemblyName>
  <TypeAssemblyVersion>1.7.0.0</TypeAssemblyVersion>
  <TypeAssemblyCulture>neutral</TypeAssemblyCulture>
  <TypeAssemblyPublicToken>99fe9917f71608a7</TypeAssemblyPublicToken>
  <IsEncrypted>True</IsEncrypted>
  <IsCompressed>True</IsCompressed>
  <EncryptionKey>151, 123, 237, 154, 69, 13, 132, 130, 233, 174, 208, 232, 85, 162, 40, 169, 161, 0, 140, 40, 47, 163, 98, 73</EncryptionKey>
  <EncryptionVector>133, 78, 229, 207, 101, 227, 102, 225</EncryptionVector>
  <TransactionTimeout>3600</TransactionTimeout>
 </DataSource>
</DataSources>

Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Ok. I think that the DataSourceKeys at the AppServer are Cached and maybe updated in some sort of Interval or when the IIS Application Pool resets. Can you confirm?




This is correct on the server side.



I think I found a bug. If an Invalid RemoteDataSourceKey is set then I get a Key not found in Dictionary error but the application halts even if it is in a Try Catch Block.




Actually what you are trying to do is not how the ES data sources are designed. Instead of changing the RemoteDataSourceKey, you are better off defining all of the data sources within your application as they are setup. Then on your BaseBO (which all of your BOs would inherit) you could set a preference in your application that would change the DataSoureKey of the BO which would then redirect where the connections are made. This way you do not have to worry with caching etc. as this connection is created when the BO creates the DataLayer (instantiation or when the CreateDataLayer method is called). This would be a more controllable and safer approach in my opinion.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search