Server exception and very simple table and DALINQ query

I added in a very simple table to my existing DA/WPF app which stores user notes, and has a single integral key value to link to other tables. Very very simple, yet i’m getting a DA/server exception which states this:

An exception occurred on the server: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

this is occuring on my DALINQ statement which is this:

      cnl := (from nrec in fDataModule.DataAdapter.GetTable<campnotes>
              where nrec.CampaignID.Equals(crec.CampaignID)
              select nrec).ToList;

this table is dirt simple - three fields. The CampaignID integral key field, the ‘Notes’ field, and some extra unused space in a third field for future expansion. All three fields are flagged as non-null. There is an existing record for my test scenario, so this query should return a single record, but instead i’m getting this exception. Any idea why?

I’m using the latest Elements and DA beta releases, in VS 2019, latest version.


Just an idea, what happens if you replace

with where nrec.CampaignID = crec.CampaignID ?

I’m not sure if Equals() as a mewtjocd call is compatible with DA LINQ./

I will try that, but i’ve used .Equal() before without any issues…

Then I’m out of ideas, and it;'d be probably something related to the actual data and./or schema of the database. I assume crec.CampaignID isn’t nil?

This error means that data returned by the database server is conflicting with the constraints applied by the Schema. The most common scenario is that database returns NULL for a schema field marked as Required (ie not accepting NULL values).

Try to mark all fields in that Schema Table as accepting null values (uncheck the Required option and starting with that 3rd unused field) and check hat is actually being returned by the server.

Or send us the database + .daSchema file so we’ll investigate it by ourselves.

Btw if possible please try to provide exception stacktraces, bot server and client-side.

Anton -

would an “empty” string field be returned as null? could that be the problem?

Well, this depends on the exact database and db field type used.
For example Oracle might return empty string field value as NULL.

OK, so i started my day. We have both our “live” system here, and a “test network” where i test out new things and changes. I went to the relativity server i have running on the test network via the admin tool to make sure nohting had changed. I logged in, and for soem reason this morning my domain is completely gone from the relativity server. how could this happen? Where is this data stored? Something got messed up. Help!

There is no API in Relativity Server that would allow to “reset” its configuration and/or delete all domains from it (*).

  • The only exception is the DASamples domain. It is NOT inteded to be used for any development and there IS an API call to reset it.

So the first step would be to check the server’s logs and see if there were any errors with loading the Domain:

Domains itself are stored (on Windows) in the folder

c:\ProgramData\RemObjects Software\Relativity\Domains

(please be sure to backup this folder before doing any manual changes in the configuration folder)

Unfortunately, the Log option doesn’t even appear when i log in to the admin tool. All i see is the server name, and the ‘Domains’ node with no domains under it. that’s all.

Gotta run out for a bit…


You need to log in as an Administrator with full access to the server.

how do i “restore” these if they are not showing up in relativity admin…but they are there in the domains directory?

Logs should contain the reason for domain failing to load?

‘Hard reset’ is to create a new Domain, stop Relativity and copy .daConnection and .daSchema files from old Domain folder.

how do i get relativity admin tool to force me to login w/ the user/password dialog? Right now it auto logs me in but not as admin

this is strange -

the web admin interface shows my domain being hosted, but not when i start relativity admin

why would that be?

Remove server registration and add it again.

For some reason (f.e. misconfiguration) user used to log in into AdminTool has a filter applied that limits domains this user can see.

Stop Relativity instance, open the file c:\ProgramData\RemObjects Software\Relativity\LoginProvider.config and make sure that SecurityRoles parameter for your user is set to *

Corresponding confi file line should look like
<Configuration Parameter="SecurityRoles" Value="*" />