On Wed, 31 Oct 2012 09:49:54 -0400 Candy Chiu <[email protected]> wrote:

CC> Vadim removed convert_from_base() from standard_use_type.  However, it
CC> still exists in use_type<values>.  It is causing an issue in insert queries
CC> that also return the auto increment id into the domain.
CC> 
CC>                 Student t = createStudent();
CC> statement st = (sql.prepare
CC> << "insert into Student (firstname, email, age, groupId, weight) "
CC> << " OUTPUT inserted.Id "
CC> << "values (:firstname, :email, :age, :groupId, :weight) "
CC> , into(student.Id),
CC> , use(student));
CC> 
CC> The convert_from_base() in post_use overwrites the data returned into
CC> student.Id.

 I'm sorry, I didn't use use_type<value> in my own code yet so I don't know
how does it work precisely. But FWIW I agree that from the general point of
view the call to convert_from_base() here should be removed too because I
believe convert_from_base() should only be called in post_fetch(), i.e.
only used for out "into" parameters and never for the "use" ones.

 It would be definitely nice to document convert_from_base() and
convert_to_base() better and clearly describe what exactly are they
supposed to do and when should they be called because there is a lot of
confusion about them, see all the commented out calls to convert_to_base().

 I could probably do it according to my understanding but it could be
incomplete, so there is a real danger of breaking something which is why I
preferred to not touch this so far. But I could at least remove the call to
convert_from_base() in use_type<value> if there are no objections.

 Are there?
VZ

Attachment: pgpwkE5Oaiqxg.pgp
Description: PGP signature

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to