Project

General

Profile

Bug #2831

[WT::Dbo] Session::find<T>() crashes after constraint failed exception on Session::add()

Added by Rodolphe Basset over 7 years ago. Updated about 7 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Target version:
-
Start date:
03/20/2014
Due date:
% Done:

0%

Estimated time:

Description

Using Session::add() to add existing objects in database throws Wt::Dbo::Exception

Exception thrown, with message :

"Sqlite3: insert into "line\" ("version", "name", "type", "annual_goal") values (?, ?, ?): constraint failed\"

That's OK.

BUT :

Any subsequent call to Session::find() on the same session makes Wt::Dbo try to flush unsaved objects and crash (segmentation fault).

I tested my inserts with successfull Session::find()

When I start from empty database, all is OK.

When objects already exists, Session is messed up after the first Exception is thrown.

Neither transaction.rollback() nor Session::rereadAll() have any effects.

Here's the stack before the crash...

somewhere in ~basic_string() (basic_string.h:538)

12 _fu204___ZNSs4_Rep20_S_empty_rep_storageE() Sqlite3.C:32 0x004a9d6b    
11 Wt::Dbo::backend::Sqlite3Statement::handleErr() Sqlite3.C:473 0x004acf14    
10 Wt::Dbo::backend::Sqlite3Statement::execute() Sqlite3.C:216 0x004abaf7    
9 Wt::Dbo::SaveBaseAction::exec() DbAction.C:150 0x004713c3    
8 Wt::Dbo::SaveDbAction<safety::Line>::visit() DbAction_impl.h:498 0x004847c6    
7 Wt::Dbo::Session::implSave<safety::Line>() Session_impl.h:282 0x004a6f7e    
6 Wt::Dbo::MetaDbo<safety::Line>::flush() ptr_impl.h:80 0x00497e43    
5 Wt::Dbo::Session::flush() Session.C:1082 0x0046fc2c    
4 Wt::Dbo::Query<Wt::Dbo::ptr<safety::Line>, Wt::Dbo::DynamicBinding>::resultList() Query_impl.h:483 0x004d12b4    
3 Wt::Dbo::Query<Wt::Dbo::ptr<safety::Line>, Wt::Dbo::DynamicBinding>::operator Wt::Dbo::collection<Wt::Dbo::ptr<safety::Line> >() Query_impl.h:505 0x004d1715    
2 exportLineCSV() main.cpp:282 0x00404118    
1 _fu32___ZSt4cout() main.cpp:328 0x0040477b

the sqlite err was 19 (SQLITE_CONSTRAINT)

I tried to discard dirty objects and rereadAll :

session.discardUnflushed();

or

session.rereadAll();

with no success...

Something is messed up somewhere, but I can't see...

Running on Windows XP SP3 / Eclipse 4.3 CDT / MinGW
using WT 3.3.1 or Wt 3.3.2 RC2 with no change.
#1

Updated by Koen Deforche over 7 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
  • Target version changed from 3.3.1 to 3.3.3
#2

Updated by Koen Deforche over 7 years ago

  • Target version changed from 3.3.3 to 3.3.4

I couldn't reproduce this.

See if you can modify testcase dbo_test10 in DboTest.C ?

#3

Updated by Koen Deforche about 7 years ago

  • Status changed from InProgress to Rejected
  • Target version deleted (3.3.4)

Also available in: Atom PDF