Der nächste Code wird normalerweise in SQLSERVER ausgeführt, aber wenn ich die web.config in die Ausführung mit mySQL nach dem loadbykey ändert, wird die Verbindung geschlossen.SUBSONIC MYSQL SharedDbConnectionScope TransactionScope
Gibt es irgendeine Konfiguration in MYSQL zu ändern, dass ???
danke jede hilfe !!!
//-----------------------------------------------------------
string tipoBanco = System.Configuration.ConfigurationManager.AppSettings["tipoBanco"];
string conexao = System.Configuration.ConfigurationManager.ConnectionStrings[tipoBanco].ToString();
using (SharedDbConnectionScope scope = new SharedDbConnectionScope(conexao))
{
//-----------------------------------------------------------
using (TransactionScope ts = new TransactionScope())
{
Cargo c = new Cargo();
c.LoadByKey(9999);
SubSonic.StoredProcedure sp = null;
sp = new SubSonic.StoredProcedure("sp_test");
sp.Command.AddParameter("paramTabela", "zzz", DbType.AnsiStringFixedLength, null, null);
Convert.ToInt32(sp.ExecuteScalar());
}
}
die web.config
<SubSonicService defaultProvider="mysql" enableTrace="false" templateDirectory="">
<providers>
<clear/>
<add name="mysql" type="SubSonic.MySqlDataProvider, SubSonic"
regexDictionaryReplace="Empresaendereco,EmpresaEndereco;Empresacontato,EmpresaContato;Franqueadoendereco,FranqueadoEndereco;Franqueadocontato,FranqueadoContato;Funcionarioacesso,FuncionarioAcesso;Funcionarioendereco,FuncionarioEndereco;Funcionariocontato,FuncionarioContato;Clienteendereco,ClienteEndereco;Clientecontato,ClienteContato;Clientehistorico,ClienteHistorico;Agendastatus,AgendaStatus;Historicostatus,HistoricoStatus"
fixDatabaseObjectCasing="true" connectionStringName="mysql"
generateRelatedTablesAsProperties="true"
fixPluralClassNames="false"
generatedNamespace="ModeloDados"
regexIgnoreCase="true"
removeUnderscores="false"
setPropertyDefaultsFromDatabase="true"
generateNullableProperties="true"
useExtendedProperties="true"
useUtc="true" />
</providers>
</SubSonicService>
möglich duplicate von [Unter Verwendung von Transaktionen mit Unterschall] (http://StackOverflow.com/Questions/910863/User-Transactions-with-subsonic) – Liam