You are not logged in.
Pages: 1
Hello,
Using mormort with ORM, sometimes happens a AV when Updating a object, and sometimes happens a 'Invalid pointer operation'. I don't know exactly how to get more information to see better what is causing this errors.
procedure TSQLRecord.GetJSONValues(W: TJSONSerializer);
var i,n: integer;
label txt,txt1;
begin
(.....)
Fields.List[i].GetJSONValues(Self,W); // Looks Like the AV happens here
W.Add(',');
end;
W.CancelLastComma; // cancel last ','
if W.Expand then
W.Add('}');
end;
the class in question:
TEmpresa = class(TSQLRecord)
(...)
published
property IdMatriz: Integer read FIdMatriz write FIdMatriz;
property RazaoSocial: RawUTF8 read FRazaoSocial write FRazaoSocial;
property NomeFantasia: RawUTF8 read FNomeFantasia write FNomeFantasia;
property CNPJ: RawUTF8 read FCNPJ write FCNPJ;
property InscricaoEstadual: RawUTF8 read FInscricaoEstadual write FInscricaoEstadual;
property InscricaoMunicipal: RawUTF8 read FInscricaoMunicipal write FInscricaoMunicipal;
property CEP: RawUTF8 read FCEP write FCEP;
property Endereco: RawUTF8 read FEndereco write FEndereco;
property EnderecoNum: RawUTF8 read FEnderecoNum write FEnderecoNum;
property Complemento: RawUTF8 read FComplemento write FComplemento;
property Bairro: RawUTF8 read FBairro write FBairro;
property Cidade: RawUTF8 read FCidade write FCidade;
property UF: RawUTF8 read FUF write FUF;
property IBGECidade: Integer read FIBGECidade write FIBGECidade;
property Telefone: RawUTF8 read FTelefone write FTelefone;
property Fax: RawUTF8 read FFax write FFax;
property Site: RawUTF8 read FSite write FSite;
property Email: RawUTF8 read FEmail write FEmail;
property Logo: TSQLRawBlob read FLogo write FLogo;
property CNAE: RawUTF8 read FCNAE write FCNAE;
property RegimeTributario: RawUTF8 read FRegimeTributario write FRegimeTributario;
property Filial: Boolean read FFilial write FFilial;
property Excluido: Boolean read FExcluido write FExcluido;
property DataCadastro: TCreateTime read FDataCadastro write FDataCadastro;
property DataAlteracao: TModTime read FDataAlteracao write FDataAlteracao;
property IDUsuarioCadastro: Integer read FIDUsuarioCadastro write FIDUsuarioCadastro;
end;
Offline
When the error happens the variable "i" has the value of 3, so I guess is the fourth field "CNPJ", that is a RawUTF8 type.
Is there any problems if the property value is null on the database?
Offline
Answering your questions:
- XE2.
- Mostly numbers, sometimes letters, something like: "1321321-54".
- SQLite.
- The last version that I did the test was this one:
http://synopse.info/fossil/info/be91367e37
I don't know if helps, but the variables values are:
i=3
n=4
colnames of the w = ('"IdMatriz":', '"RazaoSocial":', '"NomeFantasia":', '"CNPJ":', '"InscricaoEstadual":', '"InscricaoMunicipal":', '"CEP":', '"Endereco":', '"EnderecoNum":', '"Complemento":', '"Bairro":', '"Cidade":', '"UF":', '"IBGECidade":', '"Telefone":', '"Fax":', '"Site":', '"Email":', '"CNAE":', '"RegimeTributario":', '"Filial":', '"Excluido":', '"DataAlteracao":', '"IDUsuarioCadastro":');
Last edited by Kobe (2013-05-23 11:34:52)
Offline
I don't know what was causing this error, but I took off the property CNPJ from this class, and put in a ancestor class that I created just for that.
Now it's working fine, no errors.
That's weird!!
Last edited by Kobe (2013-05-24 11:14:17)
Offline
Pages: 1