Hello!
I have a problem when saving a blob property. The error is access violation on the command FManager.Save. I'm using Zeos for DB access to MySQL.
Debugger Exception Notification
Project raised exception class $C0000005 with message 'access violation at 0x00fc23b1: read of address 0x3f202824'.
The insert command is prepared correctly, except that I don't know if the blob is correctly formatted (it gives me only questionmarks and strange symbols)
From my logging:
2024-01-10 12:13:54 Debug Aurelius: INSERT INTO files (
FILE_NAME, LAST_CHANGED, CONTENT)
VALUES (
:p1, :p2, :p3)
2024-01-10 12:13:54 Debug Aurelius: p1 = InvoiceQr.rtm
2024-01-10 12:13:54 Debug Aurelius: p2 = 00:00:00
2024-01-10 12:13:54 Debug Aurelius: p3 = ???????›????? ??????????????????
I suspect that could be an Aurelius+Zeos combination problem, but I'm not sure. The call stack - on the bottom is my code, from there up is in the Manager.Save method and so on.
Any suggestion would be appreciated, since I'm stuck
Here's the code
itm := TDbFile.Create;
itm.FileName := FileName;
var strm := TFileStream.Create(FullPath, fmOpenRead);
strm.Position := 0;
itm.Content.LoadFromStream(strm);
strm.Free;
FManager.Save(itm);
And the class definition
[Entity]
[Table('files')]
[Id('FFileName', TIdGenerator.None)]
TDbFile = class(TBaseObject)
private
[Column('FILE_NAME')]
FFileName: string;
[Column('LAST_CHANGED')]
FLastChanged: TDateTime;
[Column('CONTENT', [TColumnProp.Lazy])]
FContent: TBlob;
public
property FileName: string read FFileName write FFileName;
property LastChanged: TDateTime read FLastChanged write FLastChanged;
property Content: TBlob read FContent write FContent;
end;