Hi -
We are trying to create a new tenant in a new database and we get the below error :
Castle.MicroKernel.ComponentActivator.ComponentActivatorException: ComponentActivator: could not instantiate XX.XXXXX.EntityFramework.XXXXXXXDbContext ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: CREATE DATABASE statement not allowed within multi-statement transaction.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource
1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func
3 operation, TInterceptionContext interceptionContext, Action3 executing, Action
3 executed)
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)
at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass1a.b__19(DbConnection conn)
at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass33.b__32()
at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<>c__DisplayClass1.b__0()
at System.Data.Entity.SqlServer.Def...
CLOSE
This error doesn't appear everytime but have started coming more often.
Can you let me know what could be the issue ?
Thanks, Partha
I was trying to update the Entityframework Dynamic Filter nuget package to 2.2 from 1.4 which Abp uses and I came across the below issues :
Method not found: 'Void EntityFramework.DynamicFilters.DynamicFilterExtensions.Filter(System.Data.Entity.DbModelBuilder, System.String, System.Linq.Expressions.Expression1<System.Func
3<!!0,!!1,Boolean>>, !!1)'.
I was trying to use :
modelBuilder.EnableFilter("UserOrg", (MyContext ctx) => !ctx.UserIsAdmin); which is supported in the latest Dynamic filter release, but due to Abp's hard dependencies i am unable to use it.
Could you please update to the latest Dynamic Filter .
An error occurred while retrieving package metadata for 'Abp.0.10.1.2' from source 'nuget.org'. ========== Finished ========== The HTTP request to 'GET <a class="postlink" href="https://api.nuget.org/v3/registration1-gz/abp/index.json'">https://api.nuget.org/v3/registration1- ... ndex.json'</a> has timed out after 100000ms.
I am unable to upgrade.
Hi Hilkan -
I am now using Organization ID to group the Tenants so that these Tenants can be grouped and I can later on use to share data between them. I moved my database connection to Organization where they can input connection string to a Organization and the tenant using this organization will use the connection string.
Now I am trying to create user from one tenant into all the grouped tenant under the organization , ie. let's say I have 3 tenants in one organization and i create an user in one tenant then i am creating 2 users of the same credentials in the other two tenants.
This works fine, but I am unable to link these users programatically. I am trying to create user and link them in a single unit of work.
I am unable to figure out when you are inserting records to the UserAccounts table.
Please help
I am trying to extend the Roles to Organization. Can you point me in the right direction ?
I also need to know where to override GetRolesforUser, so that I can override with GetRolesforUser(long OUId).
Castle.MicroKernel.ComponentActivator.ComponentActivatorException : ComponentActivator: could not instantiate xxxx.xxx.EntityFramework.CORPACCOUNTINGDbContext ---- System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. -------- System.InvalidOperationException : Sequence contains no matching element
I am getting this error when I run the test cases provided by AbpZero.
Any ideas?
Hi Hilkan -
It would be nice to have an example on how to use the new extension method GraphDiff. This will guide us to do further implementation
I have upgraded to the latest version of Abp and my audit Log has stopped working. Below is the error I am getting
ERROR 2016-06-06 05:10:00,794 [70 ] lers.Filters.AbpExceptionFilterAttribute - Attaching an entity of type 'xxxxx.xxxxx.Authorization.Users.User' failed because another entity of the same type already has the same primary key value. This can happen when using the 'Attach' method or setting the state of an entity to 'Unchanged' or 'Modified' if any entities in the graph have conflicting key values. This may be because some entities are new and have not yet received database-generated key values. In this case use the 'Add' method or the 'Added' entity state to track the graph and then set the state of non-new entities to 'Unchanged' or 'Modified' as appropriate.
System.InvalidOperationException: Attaching an entity of type 'xxxxx.xxxxx.Authorization.Users.User' failed because another entity of the same type already has the same primary key value. This can happen when using the 'Attach' method or setting the state of an entity to 'Unchanged' or 'Modified' if any entities in the graph have conflicting key values. This may be because some entities are new and have not yet received database-generated key values. In this case use the 'Add' method or the 'Added' entity state to track the graph and then set the state of non-new entities to 'Unchanged' or 'Modified' as appropriate.
at System.Data.Entity.Core.Objects.ObjectContext.VerifyRootForAdd(Boolean doAttach, String entitySetName, IEntityWrapper wrappedEntity, EntityEntry existingEntry, EntitySet& entitySet, Boolean& isNoOperation)
at System.Data.Entity.Core.Objects.ObjectContext.AttachTo(String entitySetName, Object entity)
at System.Data.Entity.Internal.Linq.InternalSet1.ActOnSet(Action action, EntityState newState, Object entity, String methodName) at System.Data.Entity.Internal.Linq.InternalSet
1.Attach(Object entity)
at Abp.EntityFramework.Uow.EfUnitOfWork.ObjectContext_ObjectMaterialized(DbContext dbContext, ObjectMaterializedEventArgs e)
at System.Data.Entity.Core.Objects.ObjectContext.OnObjectMaterialized(Object entity)
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.RaiseMaterializedEvents()
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper1.StopMaterializingElement() at System.Data.Entity.Core.Common.Internal.Materialization.Shaper
1.SimpleEnumerator.<MoveNextAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Data.Entity.Infrastructure.IDbAsyncEnumerableExtensions.<ForEachAsync>d__51.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at xxxxx.xxxxx.Auditing.AuditLogAppService.<GetAuditLogs>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at xxxxx.xxxxx.Interceptors.InternalAsyncHelper.<AwaitTaskWithPostActionAndFinallyAndGetResult>d__1
1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Threading.InternalAsyncHelper.<AwaitTaskWithPostActionAndFinallyAndGetResult>d__51.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3
1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
I am getting the below issue in Azure:
@Html.Action("Header", "Layout", new { currentPageName = ViewBag.CurrentPageName })
The database is fine becuase it works when I connect my local system to the database.
So I am not sure what could be causing this issue.
is there any other place other than the Language table I should look for
Hi Hilkan -
I am trying to implement Redis Cache looking at the way you have implemented UserPermissionCache. Basically I will be storing a table data into the Cache let's say "AutofillData" The table has ID, Name, few more fields
I have named my Cache to be AutofillCache and plan to store with the following key and value
Key : TenantID:OrganizationID:Autofill
Value : Should I use HashSet to store the data or do you have any other recommendations ?
I need to also update the values when items are added or modified in the table.
Could you help me in accomplishing this ?