
Originally Posted by
croftj
You can use a QMutex. Just make is static to your file ei
static QMutext mutex;
Then lock it before calling exec and unlock it once it is done.
If it's early eough in the cycle of the project to change your table, you can make the field a LARGEBLOB and then suck the file into a QByteArray and just insert/update the data like you would an int or a varchar value. This has the advantage of using standard SQL statements and can be used across a couple of differenttypes of databases.
but how run QMutext it create a file ... or only survey process?
my target is to save all open page on this cms whit only one button click.. grab each cache dir (xml.image,attachment,ecc) zip and insert on this QThread...
I observe on send to mysql (same server) need more time as a http PUT Method (3x faster) upload method. the same zip...
MYSQL dont have LARGEBLOB i found only LongBlob and can save 2GB
but i stop the folder on a dirmodel by 2.44 MB ... max mysql packet incomming by server setting.
CREATE TABLE `PAGEFILE` (
`ID` int(32) NOT NULL default '0',
`TIPO` enum('zip','pdf','txt','doc') default NULL,
`TITEL` varchar(255) default NULL,
`PIC` longblob NOT NULL,
`EPOCHE` int(32) NOT NULL default '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `PAGEFILE` (
`ID` int(32) NOT NULL default '0',
`TIPO` enum('zip','pdf','txt','doc') default NULL,
`TITEL` varchar(255) default NULL,
`PIC` longblob NOT NULL,
`EPOCHE` int(32) NOT NULL default '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
To copy to clipboard, switch view to plain text mode
Bookmarks