Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SequenceGenerator XAF Middle Tier Tenant not working #1066

Open
yunits opened this issue Aug 7, 2024 · 25 comments
Open

SequenceGenerator XAF Middle Tier Tenant not working #1066

yunits opened this issue Aug 7, 2024 · 25 comments
Labels
Bug Reactive.XAF eXpandFrameowrk/DevExpress.XAF project SequenceGenerator
Milestone

Comments

@yunits
Copy link

yunits commented Aug 7, 2024

Hi,

SequenceGenerator is not working when using Middle Tier Security.

I've attachted a simple project.
-Login as admin@company1.com
-Navigate to Sequence Storage
-try to add new for "DomainObject1" and member "number".
=> can't save

Second test:
-Navigate to Sequence Storage
-press "test" action and see error message
(test tries to get sequence storage to create in code "ObjectSpace.GetSequenceStorage(typeof(DomainObject1));"

DXApplication1.zip

@yunits yunits added Bug Reactive.XAF eXpandFrameowrk/DevExpress.XAF project labels Aug 7, 2024
@apobekiaris
Copy link
Member

I will push a tenant support but for MiddleTier I am still consulting with the Xaf team if it is possible with the current implementation or it requires a totally different approach

@apobekiaris
Copy link
Member

The pre-release 4.241.3.0 in the Reactive.XAF lab branch includes commits that relate to this task:

To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).

Released packages: No packages released.

Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.

If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.

Thanks a lot for your contribution.

@apobekiaris apobekiaris added this to the 21.2.702.0 milestone Aug 17, 2024
@yunits
Copy link
Author

yunits commented Aug 19, 2024

Thanks for your time, I will test later without Middle Tier.
I let this ticket open as memory, until you remove your assignment.

@apobekiaris
Copy link
Member

currently the Xaf team is occupied with 24.2, they will probably revisit the case later as this module is actually a user friendly encapulation of https://github.com/DevExpress-Examples/XAF_generate-a-sequential-number-for-a-persistent-object-within-a-database-transaction/tree/22.2.4%2B/CS/XPO/SequenceGenerator

@apobekiaris
Copy link
Member

speaking about the MiddleTier part

@apobekiaris
Copy link
Member

@yunits looking forward to see it u tested this one?

@yunits
Copy link
Author

yunits commented Sep 2, 2024

It looks like my issue has been fixed but since 4.241.3.1 I have a new issue:
when I use another connection string than the default one, I get error messages when I try to login as super admin.
"Login failed for user 'sa'.", "Unable to open database." and so on, but my connection string has not been changed and is still working with other applications.

working connection string:
<add name="ConnectionString" connectionString="Integrated Security=SSPI;Pooling=false;Data Source=(localdb)\mssqllocaldb;Initial Catalog=SequenceGenerator_Service" />

not working connection string:
<add name="ConnectionString" connectionString="Pooling=false;Data Source=SERVER;User ID=sa;Password=*************;TrustServerCertificate=True;Initial Catalog=SequenceGenerator_Service" />

I've created a sample without Middle Tier to test.
SequenceGenerator.zip

Steps to reproduce:

  1. modify connection string
  2. login as admin@company1.com and see it works
  3. login as admin and see error messages

@apobekiaris
Copy link
Member

The pre-release 4.241.3.0 in the Reactive.XAF lab branch includes commits that relate to this task:

To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).

Released packages: No packages released.

Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.

If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.

Thanks a lot for your contribution.

@yunits
Copy link
Author

yunits commented Sep 3, 2024

thx, I tested this without Middle Tier and it is working now!

@apobekiaris
Copy link
Member

do u impply that fails with MiddleTier?

@yunits
Copy link
Author

yunits commented Sep 11, 2024

I just didn't test this with Middle Tier as you said before that you have to consult with XAF team.

I could test it at the end of next week at the earliest.

@apobekiaris
Copy link
Member

Middle Tier

apologies my bad I meant to say Multi Tenant so I assumed that case is tested?

@yunits
Copy link
Author

yunits commented Sep 11, 2024

Tenant support has been tested using GUI with 2 tenants and is working.

I have not tested sequence creation in code, if it matters.

@apobekiaris
Copy link
Member

ok thnks in any case let me know will push in public soon

@ldfiwimb
Copy link

Hello,

This causes my Authentication=ActiveDirectoryIntegrated; connection to fail as Password="" is added to the connection string.

@apobekiaris
Copy link
Member

as always provide a sample for I can research and avoid missunderstandings, the universe is large

thnks for the understanding

@ldfiwimb
Copy link

ldfiwimb commented Oct 31, 2024

Hello,

My apologies, here is a more fulsome attempt:

The pre-release 4.241.3.0 in the Reactive.XAF lab branch includes commits that relate to this task:

This change causes my Authentication=ActiveDirectoryIntegrated; connection to fail as Password="" is added to the connection string.

ConnectionString Issue After Upgrade from 24.1.5 to 24.1.6 - Unexpected 'Password=' Added

Description:

After upgrading from version 24.1.5 to 24.1.6 of the eXpandFramework, I'm experiencing an application startup failure related to the handling of the connection string, specifically when it interacts with the SequenceGenerator.

Connection String:

XpoProvider=MSSqlServer;Server=tcp:xxx;Database=TTT;Authentication=ActiveDirectoryIntegrated;Encrypt=yes;TrustServerCertificate=True;Persist Security Info=False;MultipleActiveResultSets=True;

Problem:

When using the connection string above, the application fails to start as Password=; is unexpectedly appended to the connection string after the upgrade. This causes issues with authentication, especially since we're using ActiveDirectoryIntegrated, which does not require a password to be specified in the connection string.

Details:

In the ConnectionString method from Xpand.Extensions.XAF.Xpo.ObjectSpaceExtensions.ObjectSpaceExtensions, which was recently modified in commit 5f320dc.

Specifically, it checks if the Password part exists using connectionStringParser.PartExists("Password"). If it does not exist, the AddPart method is called to add it, which results in Password= being appended.
Screenshot Reference: I've attached a screenshot showing the relevant code snippet that appears to be responsible for this behavior.

For which the error is:
DevExpress.Xpo.Exceptions.CannotFindAppropriateConnectionProviderException: 'Invalid connection string specified: 'Server=tcp:xxx;Database=TTT;Authentication=ActiveDirectoryIntegrated;Encrypt=yes;TrustServerCertificate=True;Persist Security Info=False;MultipleActiveResultSets=True;Password=REMOVED;'.'

2024-10-31_12-44-20

@apobekiaris
Copy link
Member

my understanding is that propertyValue is "" ??

@ldfiwimb
Copy link

Correct.

image

@apobekiaris
Copy link
Member

The pre-release 4.241.6.0 in the Reactive.XAF lab branch includes commits that relate to this task:

To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).

Released packages: No packages released.

Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.

If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.

Thanks a lot for your contribution.

@apobekiaris apobekiaris removed their assignment Dec 3, 2024
@yunits
Copy link
Author

yunits commented Dec 17, 2024

@apobekiaris

currently the Xaf team is occupied with 24.2, they will probably revisit the case later as this module is actually a user friendly encapulation of https://github.com/DevExpress-Examples/XAF_generate-a-sequential-number-for-a-persistent-object-within-a-database-transaction/tree/22.2.4%2B/CS/XPO/SequenceGenerator

as 24.2 has been released, will there be any update on this issue regarding Tenant using MiddleTier?

@apobekiaris
Copy link
Member

I suggest u ask them directly it will be more efficient I am sure. Just say how can I use https://github.com/DevExpress-Examples/XAF_generate-a-sequential-number-for-a-persistent-object-within-a-database-transaction/tree/22.2.4%2B/CS/XPO/SequenceGenerator with middle-tier and post the ticker here so we all can follow it

@apobekiaris
Copy link
Member

so the question is not related to eXpand at all, we want to see their native Xaf suggestion cause the way I see it is to better use another tech for it rather the sql server kind of "hack" to create a universal lock. Sure it work fine for simple cases but Middle-Tier is not one of them

@yunits
Copy link
Author

yunits commented Dec 17, 2024

allright, I asked and will get back if I have any new informations about this.
Hopefully the devexpress team sees this as important for XAF and will create something built in.
https://supportcenter.devexpress.com/ticket/details/t1268805/sequencegenerator-for-middletier

@yunits
Copy link
Author

yunits commented Dec 19, 2024

They just answered. There seems to be some solution.

I didn't had the time to read everything.

Will check later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reactive.XAF eXpandFrameowrk/DevExpress.XAF project SequenceGenerator
Projects
None yet
Development

No branches or pull requests

3 participants