この [質問] (http://stackoverflow.com/questions/13691575/servicestack-ormlite-with-multiple-database-servers) に対する回答に従いましたが、まだエラーが発生しています。エラーは次のとおりです。
{System.Data.SqlClient.SqlException (0x80131904): 無効なオブジェクト名 'dual'。System.Data.SqlClient.SqlConnection.OnError で (SqlException 例外、ブール値の breakConnection、アクション
1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction) で System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) で System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() で System.Data.SqlClient.SqlDataReader.get_MetaData() で System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) で System.Data System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) at ServiceStack.MiniProfiler.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() at ServiceStack.OrmLite.OrmLiteReadExtensions.ExecReader(IDbCommand dbCmd, String sql) in C:\src\ServiceStack.OrmLite\src\ServiceStack.OrmLite\OrmLiteReadExtensions.cs:line 48 at ServiceStack.OrmLite.OrmLiteReadExtensions.GetScalar[T](IDbCommand dbCmd, String sql, Object[] sqlParams) in C:\src\ServiceStack.OrmLite\src\ServiceStack.OrmLite\OrmLiteReadExtensions.cs:line 498 at ServiceStack.OrmLite.Oracle.OracleOrmLiteDialectProvider.GetNextValue(IDbCommand dbCmd, String sequence, Object value) at ServiceStack.OrmLite.Oracle.OracleOrmLiteDialectProvider.ToInsertRowStatement(Object objWithProperties, IList
C:\src\ServiceStack.OrmLite\src\ServiceStack.OrmLite\ OrmLiteWriteConnectionExtensions.cs1.ToInsertRowStatement(Object objWithProperties, IDbCommand command) in C:\src\ServiceStack.OrmLite\src\ServiceStack.OrmLite\OrmLiteDialectProviderBase.cs:line 439 at ServiceStack.OrmLite.OrmLiteWriteExtensions.Insert[T](IDbCommand dbCmd, T[] objs) in C:\src\ServiceStack.OrmLite\src\ServiceStack.OrmLite\OrmLiteWriteExtensions.cs:line 394 at ServiceStack.OrmLite.OrmLiteWriteConnectionExtensions.<>c__DisplayClass42
:line 164 の ServiceStack.OrmLite.ReadConnectionExtensions.Exec( IDbConnection dbConn、アクション1 filter) in C:\src\ServiceStack.OrmLite\src\ServiceStack.OrmLite\Expressions\ReadConnectionExtensions.cs:line 55 at ServiceStack.OrmLite.OrmLiteWriteConnectionExtensions.Insert[T](IDbConnection dbConn, T[] objs) in C:\src\ServiceStack.OrmLite\src\ServiceStack.OrmLite\OrmLiteWriteConnectionExtensions.cs:line 164 at ServiceStack.ServiceInterface.Auth.OrmLiteAuthRepository.<>c__DisplayClass5.<CreateUserAuth>b__4(IDbConnection db) at ServiceStack.OrmLite.OrmLiteConnectionFactoryExtensions.Run[T](IDbConnectionFactory connectionFactory, Func
2 runDbCommandsFn) C:\src\ServiceStack.OrmLite\src\ServiceStack.OrmLite\OrmLiteConnectionFactory.cs:line 171 at ServiceStack.ServiceInterface.Auth.OrmLiteAuthRepository.CreateUserAuth(UserAuth newUser, String password) at ServiceStack.ServiceInterface .Auth.RegistrationService.OnPost(登録要求) ServiceStack.ServiceInterface.RestServiceBase`1.Post(TRequest 要求) ClientConnectionId:55977ae9-775d-474f-a543-d4cdfeb66a0d} で
私は次のコードで物事を設定しています:
private void ConfigureAuth(Funq.Container container)
{
...
//Create a DB Factory configured to access the UserAuth SQL Server DB
var connStr = appSettings.Get("SQLSERVER_CONNECTION_STRING", //AppHarbor or Local connection string
ConfigUtils.GetConnectionString("UserAuth"));
container.Register<IDbConnectionFactory>(
new AuthDBConnectionFactory(connStr, //ConnectionString in Web.Config
SqlServerOrmLiteDialectProvider.Instance)
{
ConnectionFilter = x => new ProfiledDbConnection(x, Profiler.Current)
});
//Store User Data into the referenced SqlServer database
container.Register<IUserAuthRepository>(c =>
new OrmLiteAuthRepository(c.Resolve<IDbConnectionFactory>())); //Use OrmLite DB Connection to persist the UserAuth and AuthProvider info
var authRepo = (OrmLiteAuthRepository)container.Resolve<IUserAuthRepository>();
...
}
少しして、Oracle サーバーに保持されている欠員データベースへの接続をセットアップしました。
private void ConfigureVacancies(Funq.Container container)
{
...
var connStr = appSettings.Get ("VACANCIES_CONNECTION_STRING", //AppHarbor or Local connection string
ConfigUtils.GetConnectionString("VacanciesDB"));
var dbFactory = (OrmLiteConnectionFactory)container.Resolve<IDbConnectionFactory>();
dbFactory.RegisterConnection("vacancies", connStr, ServiceStack.OrmLite.Oracle.OracleDialect.Provider);
...
}
欠員データベースへの接続は正常に機能しますが、認証データベースにユーザーを登録しようとすると、上記のエラーが発生します。オラクルの方言を保持しているように思えますか?