Base solution for your next web application

Activities of "hikalkan"

Hi @Siyeza,

Commiting the Inner required transaction should not depend on the surrounding supporess.

However, when I check the source code:

https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Domain/Uow/UnitOfWorkManager.cs#L47

I see that the behaviour is exactly like you experienced.

This should be something like if (options.Scope == TransactionScopeOption.Required && outerUow != null && outerUow.Scope != TransactionScopeOption.Suppress)

@maliming can you also check it and fix if you agree on that.

Should I raise a github issue for this?

I think it makes the log line too long. Even if we make it longer, some namespaces will be too deep and it will not cover all names. The essential point is the class name (like RequestLocalizationMiddleware in the log you've shared), namespace is not so important. But if you like, you can do it for your own solution.

[%-5.5thread] is the current thread name/id. %-40.40logger is the name of the class that writes the log line. 5 & 40 are the spaces allocated in the log line for the information. I don't know the [%property{NDC}] :) You can find more info on the web, log4net has an independent library and we are directly using it.

Yes, you are right and this is not a good behaviour. I've created an issue for this and we will consider this in next versions. See https://github.com/aspnetzero/aspnet-zero-core/issues/2585 Actually, this quick theme switch is useful in demos/development and you may disable it for production.

To switch the theme only for the current user, open the user menu (top right) and select the Visual Settings action.

This option is only available if you are not admin user (actually, a user with admin role). When a non-admin user changes the theme, it is changed for that particual user.

It is hard for us to understand with such a limited info. Can you request the AbpUserConfiguration/GetAll URL seperately and see logs. You can share the logs with us ([email protected]) so we try to understand it.

I suppose this is an Angular application. One potential problem can be the database connection. Please double check it. Maybe it timeouts. How many seconds it gets until you get HTTP 500?

You can always implement your own repository.

For example, you can take this as an example:

https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.MongoDB/MongoDb/Repositories/MongoDbRepositoryBase.cs

(This is an experimantel package and no official support)

Create a base repository class like this. Insted of injecting IMongoDatabaseProvider, directly use mongodb APIs. Then derive your repositories from this class and manually register to dependency injection.

Since AspNet Zero does not support MongoDb, this is out of support actually. But if you implement it and have a specific question (rather than a full implementation suggestion), we can try to help you.

Have a nice day.

You can use MongoDB with its own API. I think you don't have problems on inheriting from FullAuditedEntity. However, audit properties are not filled automatically and you can not inject a repository for your entity. You should go with MongoDB's capabilities, AspNet Zero has no additional service for MongoDB.

Visual Studio extensions can not run on VS for Mac. But we have created a way of using it for Mac developers.

See https://docs.aspnetzero.com/documents/aspnet-core-angular/latest/Development-Guide-Rad-Tool-Mac-Linux

While it is not a UI like the VS extension, still it can speed up you.

AbpUserConfiguration/GetAll basically performs some database queries. When you first run the application, it is the first code that connects to the database. So, if initial database connection is slow, its response can be slow.

I found many problems when I search "aws postgresql slow first connection" on Google. Some examples are https://stackoverflow.com/questions/43121081/painfully-slow-connection-speed-from-local-machine-to-aws-rds-postgresql-databas and https://serverfault.com/questions/323356/postgres-connection-establishment-slow

If you share your credentials with [email protected] (with a temporary password and maybe a readonly user), we can test it.

Hi,

I had no Postgresql, but installed locally & created database using update-database. I got an error (will share at the end of this post), however it worked. I think the migrations after this error don't effect the AbpUserConfiguration/GetAll request.

Anyway, this is the result:

It returned in 0.6 second in first run. Notice that I used a local Postgresql instance. But your application were using a remote one on amazon aws. Maybe problem is related to that. You may try to create an empty project (withot ABP) and create a connection and perform a query to see it.

So, could not repeat the problem. If you share your AWS db connection info, I can test with it too.

BTW, this is the migration error. I think you should fix this problem, otherwise you will have issues when you want to re-create your database:

PM> update-database
Applying migration '20181107154701_Initial_Migration'.
Applying migration '20181107170215_Added_Warehouse'.
Applying migration '20181107170503_Added_StockStatus'.
Applying migration '20181206170121_Added_SkuMain'.
Applying migration '20181206171942_Added_FulfillmentBy'.
Applying migration '20181206173221_Added_ShippingTemplate'.
Applying migration '20181206190113_Added_Vendor'.
Applying migration '20181206193342_Regenerated_SkuMain4563'.
Applying migration '20181206193522_Regenerated_SkuMain3808'.
Applying migration '20181206205612_Regenerated_SkuMain5557'.
Applying migration '20181207124115_Regenerated_SkuMain5029'.
Applying migration '20181207132707_Regenerated_SkuMain7340'.
Applying migration '20181207135558_Added_SkuQuantity'.
Applying migration '20181207140215_Regenerated_SkuQuantity5460'.
Applying migration '20181207142840_Added_PriceProfile'.
Applying migration '20181207143840_Added_SkuPrice'.
Applying migration '20181207145537_Regenerated_SkuPrice3977'.
Applying migration '20181207150319_Regenerated_SkuPrice1037'.
Applying migration '20181207185742_Added_SkuDetail'.
Applying migration '20181208145903_Regenerated_SkuQuantity7391'.
Applying migration '20181208163037_Regenerated_SkuQuantity8899'.
Applying migration '20181211155317_Regenerated_SkuPrice7031'.
Applying migration '20181211161050_Regenerated_SkuPrice9299'.
Applying migration '20181211173901_Regenerated_SkuDetail2605'.
Applying migration '20181211200004_Added_AsinMain'.
Applying migration '20181212154340_Regenerated_ShippingTemplate9005'.
Applying migration '20181212154619_Regenerated_ShippingTemplate7260'.
Applying migration '20181212160308_Regenerated_ShippingTemplate8840'.
Applying migration '20181212161958_Regenerated_ShippingTemplate3759'.
Applying migration '20181212204931_Regenerated_SkuQuantity4679'.
Applying migration '20181212210414_Regenerated_SkuQuantity6672'.
Applying migration '20181212210905_Regenerated_SkuDetail2991'.
Applying migration '20181213132549_Regenerated_ShippingTemplate9894'.
Applying migration '20190109200256_Added_AppQuery'.
Applying migration '20190226141814_Regenerated_SkuDetail3096'.
Applying migration '20190302115011_AmazonAsinExp'.
Applying migration '20190302121945_UpdateAmazonAsin'.
Applying migration '20190303011807_AfterRecreateStockSummary'.
Applying migration '20190303012441_Experiment'.
Applying migration '20190304152845_AppQueryRegenerate'.
Failed executing DbCommand (4ms) [Parameters=[], CommandType='Text', CommandTimeout='100']
CREATE TABLE "AppQuery" (
    "Id" serial NOT NULL,
    "TenantId" integer NULL,
    "QueryName" character varying(50) NOT NULL,
    "QueryText" text NOT NULL,
    "QueryType" integer NOT NULL,
    "Status" integer NOT NULL,
    CONSTRAINT "PK_AppQuery" PRIMARY KEY ("Id")
);
Npgsql.PostgresException (0x80004005): 42P07: relation "AppQuery" already exists
   at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0.<<ReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0.<<ReadMessage>g__ReadMessageLong|0>d.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 1032
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming) in C:\projects\npgsql\src\Npgsql\NpgsqlDataReader.cs:line 467
   at Npgsql.NpgsqlDataReader.NextResult() in C:\projects\npgsql\src\Npgsql\NpgsqlDataReader.cs:line 332
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1219
   at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken) in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1042
   at Npgsql.NpgsqlCommand.ExecuteNonQuery() in C:\projects\npgsql\src\Npgsql\NpgsqlCommand.cs:line 1025
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
42P07: relation "AppQuery" already exists
PM> 
Showing 1 to 10 of 2190 entries