sylvain | 24 Apr 16:53

can a Commit interruption damage files?


Hi, when the following test is interrupted while committing, the next
execution shows that data is lost while datafile has grown/kept its
size. I am currently using 2.4.9.6 on gentoo linux. As I am quite new
to metakit, I am wondering if I've done something wrong... Any comment
would be really appreciated.

Best regards.
Sylvain.

void test()
{
	c4_Storage db("TEST", true);
	c4_View vw = db.GetAs("tab[val:I]");
	std::cout << vw.GetSize() << " " << boost::filesystem::file_size("./
TEST") << std::endl;

	c4_Row r;
	c4_IntProp VAL("val");
	for (int i=0; i<1000000; i++) { VAL(r) = i; vw.Add(r); }

	std::cout << "About to commit" << std::endl;
	db.Commit();
	std::cout << "Commit done" << std::endl;
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "metakit" group.
To post to this group, send email to metakit <at> googlegroups.com
To unsubscribe from this group, send email to metakit-unsubscribe <at> googlegroups.com
(Continue reading)

Jean-Claude Wippler | 25 Apr 19:29

Re: can a Commit interruption damage files?


On 24 Apr 2007, at 16:54, sylvain wrote:

> Hi, when the following test is interrupted while committing, the next
> execution shows that data is lost while datafile has grown/kept its
> size.

This is normal.  The changes are not visible unless the commit  
completes fully.  Some data will have been written, but that space  
will be re-used on the next commit.  Files never shrink in size, but  
you can use db.SaveTo() to write a new compact version of the datafile.

Interrupting a commit does not damage files.

-jcw

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "metakit" group.
To post to this group, send email to metakit <at> googlegroups.com
To unsubscribe from this group, send email to metakit-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/metakit?hl=en
-~----------~----~----~----~------~----~------~--~---

sylvain | 26 Apr 14:13

Re: can a Commit interruption damage files?


Thank you for your answer Jean-Claude,

When I said data seems to be lost, I meant all the data (e.g. fully
committed in a previous process some minutes ago), not only the one
committed at the moment of interruption. Typically, I open a storage
and get my view size (which is non nul), then Add some rows and
interrupt my process while committing the changes. If then I reopen my
storage, the view size has dropped to zero.

Sylvain.

On Apr 25, 1:29 pm, Jean-Claude Wippler <j...@equi4.com> wrote:
> On 24 Apr 2007, at 16:54, sylvain wrote:
>
> > Hi, when the following test is interrupted while committing, the next
> > execution shows that data is lost while datafile has grown/kept its
> > size.
>
> This is normal.  The changes are not visible unless the commit
> completes fully.  Some data will have been written, but that space
> will be re-used on the next commit.  Files never shrink in size, but
> you can use db.SaveTo() to write a new compact version of the datafile.
>
> Interrupting a commit does not damage files.
>
> -jcw

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "metakit" group.
(Continue reading)


Gmane