Ok I give up! lazarus / 16-Databases ---------------------------------------------------------------------- liewald · 2012-03-22 15:12 for almost a year i've been trying to do something very simple but lazarus/fpc now seems incapable of performing this simpel task. what I want to do is 1 Create an in memory database 2 Add an index 3 add lots of data 4 do a locate or a sql select. This used to work using a tbufdataset but this is now proken in fpc (http://bugs.freepascal.org/view.php?id=20514#attachments) and no one seems to be interesting in fixing what I see is an error in a fundimental component.  as most of the dataset components inherit from this thaey all suffer from the same fundimental flaw and dont work. Next idea use SQLite. Ok I can create a dataset and populate if but a process that used to take 20 mins or so not takes 26 hours! not really feasigle. OK so instead of using locate I will do SQL select. seemed like a good idea but there is no way of applying a sql statement to a memory dataset! execsql and executedirect to not return result sets! I give up. I was working in delphi the other day using the sqlmemtable and everything worked perfectly.  Nirvana! ---------------------------------------------------------------------- Leledumbo · 2012-03-22 15:53 Welcome to an open source community project General rule about bug: if nobody could fix it, or have enough time/interest/knowledge to fix it, then it won't be fixed. Anyway, it seems to be already assigned to somebody to fix. So you either just wait or contact that person, possibly with whatever that can make him do it faster (if you know what I mean...) ---------------------------------------------------------------------- eny · 2012-03-22 16:56 Quote from: liewald on March 22, 2012, 04:12:40 pmNext idea use SQLite. Ok I can create a dataset and populate if but a process that used to take 20 mins or so not takes 26 hours! In general SQLite is pretty fast. I can insert 10K recs within a second in a disk based file, as long as I use transactions: start a transaction, do all inserts and end the transacion. If I commit single inserts the speed reduces to a couple of dozen inserts per second. I have to say that I never use db components and use a custom wrapper around the SQLite API. (I had to develop this because the standard components could not reliably return the value of an auto incremented field.) An in memory dataset (for me) is 4x faster so approx. 40K inserts per second. And when i do a SQL afterwards it does return the data ---------------------------------------------------------------------- fredycc · 2012-03-22 17:49 Check ZMSQL http://www.lazarus.freepascal.org/index.php?topic=13821.0 SQLite is very fast, I programmed with SQLite windows mobile with VB.Net, with Lazarus also to win PC and I found it very convenient  Regards ---------------------------------------------------------------------- joseme · 2012-03-23 03:45 If you need a in memory table, you can buy IBDac, a very good database library. It includes TVirtualTable as an extra ,works perfectly, and the price is fair. ---------------------------------------------------------------------- bambamns · 2012-03-23 05:27 If you are familiar with other languages and you need open source compiler, you can use Java and Eclipse/Net Beans where working with memory and data have a lot of ways to do it, but you will also find that , there is a lot of hard work to build an fast GUI like you can do with Lazarus (Delphi). ---------------------------------------------------------------------- BigChimp · 2012-03-23 05:54 Quote from: eny on March 22, 2012, 05:56:36 pmQuote from: liewald on March 22, 2012, 04:12:40 pmNext idea use SQLite. Ok I can create a dataset and populate if but a process that used to take 20 mins or so not takes 26 hours! I have to say that I never use db components and use a custom wrapper around the SQLite API. (I had to develop this because the standard components could not reliably return the value of an auto incremented field.) An in memory dataset (for me) is 4x faster so approx. 40K inserts per second. And when i do a SQL afterwards it does return the data  Perhaps you two can talk... If Dave has a sample program that shows what goes wrong I'm guessing eny could fix it... BTW, eny, you mentioned standard components couldn't reliably an autoinc field... do you know if that has been fixed since? ---------------------------------------------------------------------- liewald · 2012-03-23 11:00 Ok So in Summary 1. Hard Luck it's opensource (Useful !) 2. I dont use components but an api Wrapper ( is it available and does it solve the memory db problem) 3. Try ZMSQL. I did too many bugs kept crashing laz 4. Buy IBDAC ( may solve my problem but not laz) 5. dont use laz use java or c++.(development takes to long and these are transient programsand there are lots of them!) ---------------------------------------------------------------------- felipemdc · 2012-03-23 11:11 You should have tryed a bounty: http://wiki.lazarus.freepascal.org/Bounties It is probably much cheaper then the Delphi license. ---------------------------------------------------------------------- JD · 2012-03-23 11:25 Quote from: felipemdc on March 23, 2012, 12:11:53 pmYou should have tryed a bounty: http://wiki.lazarus.freepascal.org/Bounties It is probably much cheaper then the Delphi license. Very wise answer! Bounties seem to work when nothing else does. ---------------------------------------------------------------------- eny · 2012-03-23 21:28 Quote from: BigChimp on March 23, 2012, 06:54:57 amBTW, eny, you mentioned standard components couldn't reliably an autoinc field... do you know if that has been fixed since? Not that I know of. The fact that is was missing made the auto increment column type useless (hence my own API wrapper). ---------------------------------------------------------------------- BigChimp · 2012-03-24 07:24 Quote from: JD on March 23, 2012, 12:25:09 pmQuote from: felipemdc on March 23, 2012, 12:11:53 pmYou should have tryed a bounty: http://wiki.lazarus.freepascal.org/Bounties It is probably much cheaper then the Delphi license. Very wise answer! Bounties seem to work when nothing else does. In any event, I don't think Dave posted some simple sample program that demonstrated his sqlite in-memory database problems... I'd say that's the first step in getting a solution, whether by bounty, bugtracker or here in the forum (unless it's a very simple problem). If he did post such code: sorry, must have overlooked it... @eny: thanks. ---------------------------------------------------------------------- liewald · 2012-03-26 12:53 Willdo