Forum Replies Created
-
AuthorPosts
-
-
June 18, 2023 at 13:46 #57209
mrluigi2017
ParticipantHi Kim,
It looks like this one is reintroduced in version 5.21 (and still there in 5.22)
Kind regards,
Luigi
-
January 10, 2023 at 13:21 #56935
mrluigi2017
ParticipantI have written al little test application and I noticed that the tripple quotes only appear when quotes are used when creating tables. Since this is a new project I have decided to use uppercase and no quotes for tables names (and other identifiers).
-
January 10, 2023 at 12:07 #56933
mrluigi2017
ParticipantMessage removed.
-
This reply was modified 3 years, 1 month ago by
mrluigi2017.
-
This reply was modified 3 years, 1 month ago by
-
January 10, 2023 at 09:30 #56932
mrluigi2017
ParticipantThe connection pool is a TkbmMWUNIDACConnectionPool with a kbmMWInterbaseMetaData and a kbmMWInterbaseSQLRewriter.
-
December 20, 2022 at 09:41 #56843
mrluigi2017
ParticipantWe use Pascal case for our database including the sequences. I have change the sequences to upper case now π
-
November 24, 2022 at 14:58 #56786
mrluigi2017
ParticipantSorry that π I am using kbmMWHTTPSysServerTransport. I have tested it with kbmMWTCPServerTransport and kbmMWTCPIPIndyServerTransport and that seems to works fine.
-
November 24, 2022 at 11:28 #56784
mrluigi2017
ParticipantIt looks like that in unit kbmMWHTTPSysServerTransport (didn’t check other transports yet) on line 579 the status code that is set is overwritten by this line of code:
reshlp.HTTPStatusCode:=reshlp.HTTPStatusCodeFromServerStatusCode(res.StatusCode);
-
November 24, 2022 at 11:11 #56783
mrluigi2017
ParticipantIn Fiddler and Postman I still get a 200 status code instead of 201. Are you sure that this should work?
-
April 9, 2021 at 08:02 #55662
mrluigi2017
ParticipantHi Charles,
Some things you might want to check:
1) Do you have a MetaData component attached to the kbmMWMySQLRewriter?
2) Do you have a kbmMWMySQLRewriter attached to the kbmMWFiredacConnectionPool?
3) Does the table name in your entity match the table name in MySQL [kbmMW_Table(‘name:person’)]
4) Make sure that the meta data component properties like “quote table name” etc. match your situation.Kind regards,
Luigi
-
February 18, 2021 at 16:42 #55479
mrluigi2017
ParticipantDu er fantastisk π
-
This reply was modified 5 years ago by
mrluigi2017.
-
This reply was modified 5 years ago by
-
February 8, 2021 at 09:41 #55442
mrluigi2017
ParticipantHi,
If I remember it well there where some serious issues in XE5 with generics which are heavily used in the ORM framework. I think you need XE7 or up.
-
This reply was modified 5 years ago by
mrluigi2017.
-
This reply was modified 5 years ago by
-
January 26, 2021 at 23:06 #55429
mrluigi2017
ParticipantNever mind I found the solution.
var
qv: TkbmMWHTTPQueryValues; // kbmMWHTTPUtils
hlp: TkbmMWHTTPTransportStreamHelper;
s: string;
begin
qv := TkbmMWHTTPQueryValues.Create;
try
hlp := TkbmMWHTTPTransportStreamHelper(RequestTransportStream.Helper);
qv.AsString := hlp.Query; // Contains the part after the ?
s := qv.ValueByName[‘test’];…
-
January 26, 2021 at 23:04 #55427
mrluigi2017
ParticipantAre you sure this should work? I can’t get it working here.
-
This reply was modified 5 years ago by
mrluigi2017.
-
This reply was modified 5 years ago by
-
September 27, 2020 at 11:33 #55109
mrluigi2017
ParticipantCould you log the SQL statement? I use Devart and they have a monitor tools which shows you all the SQL which is sent to the user. If not you could maybe use the kbmmw log function:
kbmMWDebugLevel := mwdlAll;
kbmMWDebugWhere := mwddDebug;
kbmMWDebugTypes := [mwdtDBQuery];It logs to the IDE messages window.
-
September 11, 2020 at 19:13 #55071
mrluigi2017
ParticipantJust forgot to add kbmmwOrm to the uses π The errr I got was “Class is missing kbmMW_table or virtual table attribute”.
-
August 24, 2020 at 18:27 #54999
mrluigi2017
ParticipantI am using enterprise 5.12.00 and both units are present. I think something went wrong with the setup.
-
April 15, 2020 at 10:47 #54643
mrluigi2017
ParticipantHi Kim,
It works π Just tested it with a 64GB file up and down.
It is true that I did not anticipate sending huge files (>2GB) back in the days.
I don’t blame you. It takes more than 31 weeks on a 28.8 modem π
Thank you!!!
-
This reply was modified 5 years, 10 months ago by
mrluigi2017.
-
This reply was modified 5 years, 10 months ago by
-
April 12, 2020 at 09:56 #54591
mrluigi2017
ParticipantWhat exactly do you mean? You can set the blocksize in the kbmMWFileClient. I haven’t figured out yet howto deal with the filesize issue.
-
April 3, 2020 at 15:52 #54581
mrluigi2017
ParticipantHi Job,
There is a demo that contains brief cases. Not sure if it works or not. It can be found in the demo folder:
kbmmw\Demo\Basic\Client
Kind regards,
Luigi
-
March 30, 2020 at 21:53 #54579
mrluigi2017
ParticipantThe slow transfer issue is solved. I have changed the chunksize to 1048576 and the speed is good now. There is however still an issue with downloading a large file. See the code in the second post. Uploading large files (larger than max int) doesn’t seem to be a problem.
-
March 30, 2020 at 16:05 #54578
mrluigi2017
ParticipantI also have an issue that the transfer is very, very slow. I think I am doing something wrong, but I have no clue what it is.
-
March 28, 2020 at 17:47 #54577
mrluigi2017
ParticipantI figured out that downloading a large file doesn’t work either. I think the cause is that an int 64 is assigned to an VarArray with varIntegers.
function TkbmMWFileService.PerformGET
Result:=VarArrayCreate([0,2],varInteger);
// Prepare result.
Result[0]:=FFileToken;
Result[1]:=ofs; //is an int64
Result[2]:=sz; // is an int64Although I didn’t find anything for my upload problem I suspect it could be the same type of issue.
-
March 26, 2020 at 09:16 #54576
mrluigi2017
ParticipantI had some issues with the ImportDBSchema as well so I wrote my own tool for Postgres databases. I am not sure if the import tool is fixed by now.
I have used the kbmMWInterbaseSQLRewriter and it worked for me. It’s also important to connect a kbmMWInterbaseMetaData component to the Rewriter component. The metadata component takes care about things like uppercase/lowercase, the use of quotes, date layout, etc.
I supspect that you didn’t build for 64 bit or that you forgot to set the correct paths.
-
March 25, 2020 at 20:58 #54574
mrluigi2017
ParticipantHi Alexander,
As far as I know there is no specific documentation on the rewriter. The rewriter is needed when you use the ORM. It rewrites the SQL to match your target database requirements. It compiles on Win64 here without a problem (I am using enterprise) What version do you use? And what error do you get?
-
September 8, 2019 at 08:46 #54178
mrluigi2017
ParticipantNever mind. I am just a moron π The dataset was empty
-
September 8, 2019 at 08:27 #54177
mrluigi2017
ParticipantI think it’s not a bug. I will open a new topic.
-
September 7, 2019 at 16:29 #54174
mrluigi2017
ParticipantAny change that there is a bug in the ListFromDataset method as well?
-
August 22, 2019 at 07:55 #54149
mrluigi2017
ParticipantIt seem that in the destructor all the objects used in the add record method a freed, but that is not the case. For instance a1 is used as a reference for 3 different objects and only 1 of them is freed in the destructor.
-
August 13, 2019 at 09:59 #54133
mrluigi2017
ParticipantYou could use the orm for this. I wrote a little very basic demo. I used firedac as a connection but you can change this. You need to setup the firedacΒ connection before you can use it. (Make a test database for it!) In the demo you have to take care of the primary key(message_id) yourself.
Here is a link to the code:
https://lycaproductions.stackstorage.com/s/5L82VjorZ4ylSNC
is valid till 31-08-2019
Here the code itself:
unit f_main;
interface
uses
kbmMWOrm,
kbmMWNullable,
kbmMWRtti,Data.DB,
Generics.Collections,
Winapi.Windows,
Winapi.Messages,
System.SysUtils,
System.Variants,
System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
kbmMWCustomConnectionPool,
kbmMWFireDAC,
kbmMemTable,
Vcl.ExtCtrls,
Vcl.DBCtrls,
Vcl.Grids,
Vcl.DBGrids,
Vcl.StdCtrls,
kbmMemCSVStreamFormat,
FireDAC.Stan.Intf,
FireDAC.Stan.Option,
FireDAC.Stan.Error,
FireDAC.UI.Intf,
FireDAC.Phys.Intf,
FireDAC.Stan.Def,
FireDAC.Stan.Pool,
FireDAC.Stan.Async,
FireDAC.Phys,
FireDAC.Phys.FB,
FireDAC.Phys.FBDef,
FireDAC.VCLUI.Wait,
FireDAC.Comp.Client,
kbmMWSQLRewriter,
kbmMWCustomSQLMetaData,
kbmMWInterbaseMetaData;type
TForm1 = class(TForm)
kbmMWFireDACConnectionPool: TkbmMWFireDACConnectionPool;
// Notice that the kbmCSVStreamFormat is set to the AllDataFormat property
mtMessages: TkbmMemTable;
dsMessages: TDataSource;
DBNavigator: TDBNavigator;
grdMessages: TDBGrid;
btnSaveToFile: TButton;
btnSaveToFireBird: TButton;
kbmCSVStreamFormat: TkbmCSVStreamFormat;
btnOpenFromFile: TButton;
btnOpenFromFireBird: TButton;
FDConnection: TFDConnection;
mtMessagesmessage_id: TIntegerField;
mtMessagesmessage_text: TStringField;
btnOpen: TButton;
btnCreateTable: TButton;
kbmMWInterbaseMetaData: TkbmMWInterbaseMetaData;
kbmMWInterbaseSQLRewriter: TkbmMWInterbaseSQLRewriter;
procedure btnCreateTableClick(Sender: TObject);
procedure btnOpenClick(Sender: TObject);
procedure btnOpenFromFileClick(Sender: TObject);
procedure btnSaveToFileClick(Sender: TObject);
procedure btnSaveToFireBirdClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
Orm: TkbmMWORM;
public
procedure SaveMessageMemoryTableToFile;
procedure SaveMessageMemoryTableToFireBird;procedure LoadMessagesFromFile;
procedure LoadMessageFromFireBird;
end;[kbmMW_Table(‘name:my_messages’)]
TMyMessage = class
private
FMessageID: kbmMWNullable<Integer>;
FMessageText: kbmMWNullable<string>;
public
[kbmMW_Field(‘name:message_id, primary:true’, ftInteger)]
property MessageID: kbmMWNullable<Integer> read FMessageID write FMessageID;[kbmMW_Field(‘name:message_text’, ftString)]
property MessageText: kbmMWNullable<string> read FMessageText write FMessageText;
end;var
Form1: TForm1;implementation
{$R *.dfm}
procedure TForm1.btnCreateTableClick(Sender: TObject);
begin
if not Orm.ExistsTable(TMyMessage) then
beginif Orm.CreateTable(TMyMessage) then
ShowMessage(‘TMyMessage Table Created’)
else
ShowMessage(‘Error creating table’);end;
end;procedure TForm1.btnOpenClick(Sender: TObject);
begin
mtMessages.Open;
end;procedure TForm1.btnOpenFromFileClick(Sender: TObject);
begin
LoadMessagesFromFile;
end;procedure TForm1.btnSaveToFileClick(Sender: TObject);
begin
SaveMessageMemoryTableToFile;
end;procedure TForm1.btnSaveToFireBirdClick(Sender: TObject);
begin
SaveMessageMemoryTableToFireBird;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
// You can change the connection pool to the one you like.
// Before you can persist to the database,
// you have to make sure that the connection pool is setup.
Orm := TkbmMWORM.Create(kbmMWFireDACConnectionPool);
end;procedure TForm1.LoadMessageFromFireBird;
var
MessageList: TObjectList<TMyMessage>;
begin
MessageList := Orm.QueryList<TMyMessage>;
Orm.ToDataset<TMyMessage>(MessageList, True);
end;procedure TForm1.LoadMessagesFromFile;
begin
mtMessages.LoadFromFileViaFormat(‘.\MyMessagFile.csv’, kbmCSVStreamFormat);
end;procedure TForm1.SaveMessageMemoryTableToFile;
begin
mtMessages.SaveToFileViaFormat(‘.\MyMessagFile.csv’, kbmCSVStreamFormat);
end;procedure TForm1.SaveMessageMemoryTableToFireBird;
var
MessageList: TObjectList<TMyMessage>;
begin
MessageList := Orm.ListFromDataset<TMyMessage>(mtMessages, [usModified, usInserted, usDeleted]);
Orm.Persist(MessageList);
end;initialization
TkbmMWRTTI.EnableRTTI([TMyMessage, TObjectList<TMyMessage>]);
kbmMWRegisterKnownClasses([TMyMessage, TObjectList<TMyMessage>]);end.
-
This reply was modified 6 years, 6 months ago by
mrluigi2017.
-
This reply was modified 6 years, 6 months ago by
-
August 7, 2019 at 21:46 #54122
mrluigi2017
ParticipantI guess it’s bedtime for me π Thank you!
-
August 3, 2019 at 16:48 #54109
mrluigi2017
ParticipantMin tak er stor! Only now do I realize how powerful smartbinding is. It makes life a lot easier.
-
This reply was modified 6 years, 6 months ago by
mrluigi2017.
-
This reply was modified 6 years, 6 months ago by
-
July 29, 2019 at 15:52 #54105
mrluigi2017
ParticipantDid you do a license request in the portal?
-
May 30, 2019 at 12:20 #54043
mrluigi2017
ParticipantThe main issue was that the fields where created dynamically . I now have to separate methods one for REST clients and one for kbmmw clients. I also have two different result objects. The REST result object still marshals the memtable (no issues with this) I have replaced the memtable for a stream in the kbmmw result object and added a property with a getter that loads the stream into a memtable. This way the memtable never gets marshalled
Maybe this solution is usefull to others.
-
May 22, 2019 at 15:08 #54000
mrluigi2017
ParticipantNever mind I did something very stupid π
I had a dbaware control connected to a DataSource->kbmMemTable with a wrong datafield value in it. So the ToDataset method works fine but when it opens it goes wrong because of the wrong datafield.Β I should have known it wasn’t kbmmw π Sorry!
-
This reply was modified 6 years, 9 months ago by
mrluigi2017.
-
This reply was modified 6 years, 9 months ago by
mrluigi2017.
-
This reply was modified 6 years, 9 months ago by
-
May 22, 2019 at 14:34 #53999
mrluigi2017
ParticipantYes I did. Not sure if it’s important but the ToDataset method is not in the same unit as where I call the smartclient function returning the object that is usedΒ in the ToDataset method.
-
May 14, 2019 at 11:00 #53987
mrluigi2017
ParticipantThat would be nice because in combination with the orm many objects will have nullable properties I think.
-
May 11, 2019 at 15:26 #53981
mrluigi2017
ParticipantI forgive you and I still love you π You’re just working to hard π
-
May 11, 2019 at 15:10 #53979
mrluigi2017
ParticipantAre you 1000% sure? I have download 7.82 again just to be sure. But the kbmMemTable.pas shows
const KBMMEMTABLE_VERSION = ‘7.81.00’;
The fix comments in the same unit stop at version 7.81. as well.
-
May 11, 2019 at 12:58 #53974
mrluigi2017
ParticipantSupercool π Can’t wait to try it out.
-
May 10, 2019 at 09:22 #53971
mrluigi2017
ParticipantMost ORM frameworks I know use some kind of dataset between the GUI and the logic. Can the same be accomplished in kbmmw if you twoway smartbind a memtable to a TObjectList/TObject?
-
This reply was modified 6 years, 9 months ago by
mrluigi2017.
-
This reply was modified 6 years, 9 months ago by
-
May 9, 2019 at 13:01 #53968
mrluigi2017
ParticipantIm not sure exactly what you are asking.
I was afraid for that π One more try…
When you use datasets and data-aware controls the data-aware controls change from editable to non editable states depending on the state of the dataset dsEdit, dsBrowse etc. The dbnavigator enables only relevant buttons.This works very easy. I wonder if the same enabling/disabling of input controls can be accomplished with smartbinding and non dataset objects in an easy way.
-
This reply was modified 6 years, 9 months ago by
mrluigi2017.
-
This reply was modified 6 years, 9 months ago by
-
April 11, 2019 at 08:58 #53896
mrluigi2017
ParticipantHi Francisco,
I think I used that construction before, but it gave some issues (not sure anymore what it was). I didn’t have time to dive into it, but I think something has changed between te previous release I usedΒ an this one.
-
April 1, 2019 at 11:38 #53514
mrluigi2017
ParticipantI am not sure if I understand you correctly. Are you saying that just the visual output of a null value is zero (in case of an integer) or that the value will be zero? When reading my postgres logs I think it’s the second, but that doesn’t make senseΒ to me because both JSON an the database can take care of null.
-
March 25, 2019 at 18:14 #53507
mrluigi2017
ParticipantWell the thing is that you make it to easy so we get a little lazy π
-
March 25, 2019 at 15:08 #53504
mrluigi2017
ParticipantThanks for both answers! It would be nice feature if there wouldn’t be a need to write the kbmmw syntax.
-
This reply was modified 6 years, 11 months ago by
kimbomadsen.
-
This reply was modified 6 years, 11 months ago by
-
February 28, 2019 at 14:26 #53461
mrluigi2017
ParticipantI have added the one line of code and it works π
Not sure if this is a general solution or just for kbmMWUnidac and PostgreSQL. I think it is a general solution because I believe that transactions should be only controlled from within the kbmmw framework.
I have added this line of code in the InternalOpenConnection method.
FDatabase.AutoCommit := False; // Is true by default in UniConnection
-
February 28, 2019 at 10:15 #53460
mrluigi2017
ParticipantI did some testing with kbmmwFiredac yesterday and it works fine. I think you are right that it has to do with transaction settings. I don’t want to blame kbmmw π but could it be that in the unidac adapter InternalOpenConnection method some connection properties are not set? Am I right that if a property isn’t set here the default value is used?
Thanks in advance!
-
February 6, 2019 at 20:08 #53429
mrluigi2017
ParticipantHow about ORM and Postgres? Will it work if I create a generator with a sequence or will the problem be the same behind the scenes?
-
February 6, 2019 at 13:00 #53428
mrluigi2017
ParticipantWhat I try to accomplish is that I can resolve a join with ORM and that I can show the join (virtual table) as one dataset. Is there an easy way to do that?
The only solution I see now is that in case of a TPerson with a TAddress is to add all TAddress properties as virtual fields to a TPersonWithAddress object and create a TAddress object and copy the values from the virtual addresss fields from TPersonWithAddress before persisting. (That’s an ugly sentence π )
-
January 6, 2019 at 21:00 #53399
mrluigi2017
ParticipantI looks like the mime type var never makes it to the UmarshalBody method in kbmMWSmartServiceUtils.
My http header looks like this:
User-Agent: Fiddler
Mime-Type: application/json
Host: 192.168.0.56
Content-Length: 39Am I doing something wrong or is this a bug?
-
-
AuthorPosts
