You are not logged in.
Pages: 1
Argh ....
Well, I'm agree with you.
I'm trying to be DDD.
That's why I have an Agregat with my Domain, anda DataTransfertObject.
And I need to translate one to the other
Hello,
I've trouble with the TSQLRawBlob type.
When I try to Transfert Data from a generic object to my agregat, using RTTI function to make it work in all case, it didn't succed with property of this type whereas it's ok when the same proprerty is RawUTF8.
Here is the part of code where I lose my value.
function TCommonDataTransfertObject.SetBasicProperty(aProp: TRttiProperty;
aValue: Variant; aSourceAsPointer: Pointer;
aPropertyType: System.TTypeKind): Boolean;
begin
Result := False;
try
case aPropertyType of
// ...
System.tkUString, System.tkString, System.tkWChar, System.tkWString,
System.tkChar, System.tkLString:
begin
if not VarIsNull(aValue) then
aProp.SetValue(aSourceAsPointer, VarToStr(aValue))
else aProp.SetValue(aSourceAsPointer, '');
end;
end;
Result := True;
except
Result := False;
end;
end;
Any idea ?
Regards
Hi,
Too bad ...
It doesn't matter, we'll do it in an other way.
Thanks
Hello,
As it is show in samples, with mORMot we can specify callback with a service (Chat sample).
This is make using a simple parameter of a function.
Is it possible to pass this information within a generic array of parameters, a collection of variant like this :
TCommonGenericProperty = class(TCollectionItem)
private
FName : ShortString;
FPropertyType : TTypeKind;
FValue : Variant;
published
property Name : ShortString read FName write FName;
property PropertyType : TTypeKind read FPropertyType write FPropertyType;
property Value : Variant read FValue write FValue;
end;
Will it be well serialize ?
How to get it on the server side ?
regards.
It doesn't matter.
Regards
The 2 databases are the same (come from an client's export).
Perhaps it is something like the rigths between the 2 computers.
I'm stil invastigating this problem and working on other fonctions of your framework.
So I'll be back to you as I've some news.
Hello AB,
I work a bit on my trouble, and it seems that I've identified somethings :
- my trouble is function of the structure of the external table I try to lock.
If I use a typical table, with an standard ID Field, and another such as VAL1, it work fine (retrieve records and update them)
In fact most of our tables don't have such ID field's name, but often NOID or NO_PLAN.
And the lock I have depends if I try to map a field or not.
Can this help you ?
Well,
I'have tried on an other computer (no firewall) and it's the same result...
Something strange :
FOracleProps := TSQLDBOracleConnectionProperties.Create('//Delldev5:1526/Urios', '', 'URIOS_INF', 'VALIDU');
lSQLDBConnection := FOracleProps.NewConnection;
lSQLDBConnection.Connect
if not lSQLDBConnection.Connected then
raise Exception.Create('Message d''erreur');
-> the connection is Ok
And something like Firewall ?
But why did I succed with SynDbExplorer ?
I'm going to try on an other computer.
Yes, I used to.
I'have tried :
FMainDataModel := TSQLModel.Create([TSQLPlan]);
and
FMainDataModel := TSQLModel.Create([]);
FMainDataModel.AddTable(TSQLPlan);
I'have tried with the file deleted.
It's the same : I saw the file being generated (Main.db3 and Main.db3-journal), but noting after.
Here are some informations I can give you:
The last point before I lose the application running:
procedure TSQLDataBase.GetFieldNames(var Names: TRawUTF8DynArray; const TableName: RawUTF8);
var R: TSQLRequest;
n: integer;
begin
if (self=nil) or (fDB=0) then
exit; // avoid GPF in case of call from a static-only server
Lock;
try
try
*********************************************************************
R.Prepare(fDB,'PRAGMA table_info('+TableName+');'); // ESQLite3Exception
*********************************************************************
n := 0;
repeat
if R.Step<>SQLITE_ROW then break;
if n=length(Names) then
SetLength(Names,n+MAX_SQLFIELDS);
Names[n] := sqlite3.column_text(R.Request,1); // cid,name,type,notnull,dflt_value,pk
inc(n);
until false;
SetLength(Names,n);
finally
R.Close;
end;
finally
UnLock;
end;
end;
And the stack :
SynSQLite3.TSQLDatabase.GetFieldNames((),'Plan')
mORMotSQLite3.TSQLRestServerDB.CreateMissingTables(0,[])
srvMainDm_.TsrvMainDm.ConnectMainDB
SrvMainFrm_.TForm3.Button5Click($2D830A0)
Hope this can help you
Well with the SynDBExplorer, the connection string works fine !
Hello,
I'm trying to use mORMot with a Standard Database having an external Table in a Oracle DB, by this way :
procedure TsrvMainDm.ConnectMainDB;
begin
TSynLog.Enter(Self, 'ConnectMainDB');
FOracleProps := TSQLDBOracleConnectionProperties.Create('URIOS', '', 'URIOS_INF', 'VALIDU');
//FOracleProps := TSQLDBOracleConnectionProperties.Create('//DellTHIBAUT:1526/Urios3', '', 'URIOS_INF', 'VALIDU');
FMainDataModel := TSQLModel.Create([]);
FMainDataModel.AddTable(TSQLPlan);
// Redirection d'une table du modele sur la base Oracle
VirtualTableExternalRegister(FMainDataModel, TSQLPlan, FOracleProps, 'P_PLAN');
FMainDataModel.Props[TSQLPlan].ExternalDB.MapField('ID', 'NO_PLAN');
FMainDB := TSQLRestServerDB.Create(FMainDataModel, 'Main.db3', True);
FMainDB.CreateMissingTables(0);
end;
This work fine when the Oracle database is on my computer ("URIOS" case).
But when it is on a remote one (on the local network) I lose my application during "FMainDB.CreateMissingTables(0);".
Any Idea why ?
Thank you
Pages: 1