-
-
Notifications
You must be signed in to change notification settings - Fork 506
Open
Description
Log
Marten encountered an exception executing
select CustomName.mt_overwrite_product($1,$2,$3,$4,$5);
: {REDACTED}
: SomeNamespace.SomeType
: 00025d06-0000-0000-0000-000000000000
:
: 4
Npgsql.PostgresException (0x80004005): 42601: syntax error at end of input
POSITION: 38
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
at Marten.Internal.Sessions.AutoClosingLifetime.ExecuteBatchPagesAsync(IReadOnlyList`1 pages, List`1 exceptions, CancellationToken token) in /_/src/Marten/Internal/Sessions/AutoClosingLifetime.cs:line 315
Exception data:
Severity: ERROR
SqlState: 42601
MessageText: syntax error at end of input
Position: 38
File: scan.l
Line: 1236
Routine: scanner_yyerror
prodcedure source
create function mt_overwrite_product(doc jsonb, docdotnettype character varying, docid uuid, lastmodifiedby character varying, revision integer) returns integer
language plpgsql
as
$$
DECLARE
final_version INTEGER;
current_version INTEGER;
BEGIN
if revision = 0 then
SELECT mt_version FROM CustomName.mt_doc_product into current_version WHERE id = docId ;
if current_version is not null then
revision = current_version + 1;
else
revision = 1;
end if;
end if;
INSERT INTO CustomName.mt_doc_product ("data", "mt_dotnet_type", "id", "last_modified_by", "mt_version", mt_last_modified, mt_created_at) VALUES (doc, docDotNetType, docId, lastModifiedBy, revision, transaction_timestamp(), transaction_timestamp())
ON CONFLICT (id)
DO UPDATE SET "data" = doc, "mt_dotnet_type" = docDotNetType, "last_modified_by" = lastModifiedBy, "mt_version" = revision, mt_last_modified = transaction_timestamp();
SELECT mt_version FROM CustomName.mt_doc_product into final_version WHERE id = docId ;
RETURN final_version;
END;
$$;
alter function mt_overwrite_product(jsonb, varchar, uuid, varchar, integer) owner to CustomName;
marten config
builder.Services.AddMarten(options =>
{
options.Connection(builder.Configuration.GetConnectionString("CustomName")!);
options.DatabaseSchemaName = "CustomName";
options.DisableNpgsqlLogging = true;
options.Events.MetadataConfig.UserNameEnabled = true;
options.UseSystemTextJsonForSerialization(ConfigureJson(new JsonSerializerOptions()));
options.Schema.For<Product>().Metadata(m =>
{
m.LastModified.MapTo(x => x.UpdatedAt);
m.LastModifiedBy.Enabled = true;
m.LastModifiedBy.MapTo(x => x.UpdatedBy);
m.CreatedAt.Enabled = true;
m.CreatedAt.MapTo(x => x.CreatedAt);
});
options.Projections.Add<ProductProjection>(ProjectionLifecycle.Async);
options.UpdateBatchSize = 100_000;
})
.AddAsyncDaemon(DaemonMode.HotCold)
.UseLightweightSessions()
.PublishEventsToWolverine("Everything")
.IntegrateWithWolverine(cfg =>
{
cfg.UseFastEventForwarding = true;
cfg.UseWolverineManagedEventSubscriptionDistribution = true;
});
Anything else I need to supply?
I didn't find a workaround for it yet nor how this issue occurred in the first place
Thus only 125 of 52,868 documents are created. I don't know why some work and mostly all other fail
Metadata
Metadata
Assignees
Labels
No labels