Instantaneous Transactions
Posted: Fri Aug 07, 2009 10:43 am
by JADE Kid - Ray Hidayat >> Wed, 12 Jul 2000 2:41:18 GMT
I just worked out why I could not load large files into my database. But still, I don't have a way to fix the problem.
So until now, I have chunked the file into bite-size pieces because I thought that if I added little pieces to the file at a time, it wouldn't bring up the error "No memory for buffers"
But the problem wasn't that. Here is the code with the problem (in the FileTrans transient class, the place where files are stored to send to other people):
while rec <> null do
rec := _file.readBinary (65536);begin
TransientTransaction;
file := file & rec;
commitTransientTransaction;
endwhile;
That may look harmless. But look closer.
begin
TransientTransaction;
file := file & rec;
commitTransientTransaction;
The problem here is right here
file := file & rec;
^
When this file variable gets to a significantly large size, it won't fit in the transaction buffer.
That causes the error "No memory for buffers"
But I don't need a buffer. The transaction is not going to be aborted.
And as far as I know, there is no way to fix this at the current moment. Anyone have a solution to do an "Instantaneous Transaction" which enters the information straight away into the database without a buffer?
Now that I think of it, does anyone actually use the 'abortTransaction' method?
--
Ray Hidayat
JADE Kid - 2000
www.jadekids.com
I just worked out why I could not load large files into my database. But still, I don't have a way to fix the problem.
So until now, I have chunked the file into bite-size pieces because I thought that if I added little pieces to the file at a time, it wouldn't bring up the error "No memory for buffers"
But the problem wasn't that. Here is the code with the problem (in the FileTrans transient class, the place where files are stored to send to other people):
while rec <> null do
rec := _file.readBinary (65536);begin
TransientTransaction;
file := file & rec;
commitTransientTransaction;
endwhile;
That may look harmless. But look closer.
begin
TransientTransaction;
file := file & rec;
commitTransientTransaction;
The problem here is right here
file := file & rec;
^
When this file variable gets to a significantly large size, it won't fit in the transaction buffer.
That causes the error "No memory for buffers"
But I don't need a buffer. The transaction is not going to be aborted.
And as far as I know, there is no way to fix this at the current moment. Anyone have a solution to do an "Instantaneous Transaction" which enters the information straight away into the database without a buffer?
Now that I think of it, does anyone actually use the 'abortTransaction' method?
--
Ray Hidayat
JADE Kid - 2000
www.jadekids.com