[odb-users] Error modifying change-tracking odb::vector created with copy constructor

Baker, Vincent J vincent.j.baker at lmco.com
Tue Jul 15 15:09:01 EDT 2014


I'm having a problem using odb::vector. The following illustrates the issue:

odb::vector<int> ov1 = odb::vector<int>(); //Create an odb vector
ov1._start(); //Start change tracking (in real application code it's started by database operations)
ov1.push_back(11); //Put a data value into the vector
odb::vector<int> ov2(ov1); //Create a new odb vector using the copy constructor
ov2.modify(0) = 12;  //This line causes a core dump

It appears that the copy constructor copies the data over, and the change-tracking state of ov2 is set to "tracking". However, the "_data" member of ov2 is null. _data is then referenced by the modify operation. I expected the copy constructor to copy over the change state for the data as well as the data itself, but that doesn't seem to happen.

I'm using odb 2.3.0 with gcc 4.6.3.

Vincent Baker

More information about the odb-users mailing list