Hey Tor,
2014-03-21 11:48 GMT+01:00 Tor Arne Fallingen <fallin...@gmail.com>:
> Hey again koen,
>
> Im using the blog example, looking at the code and how its structured,
> plus using your library descriptions to try and understand how I would
> adopt the connection pool to my application. Im a little uncertain about
> something here and feel like asking you a question. First, let me paste a
> little part of the code from BlogSession:
>
> BlogSession::BlogSession(dbo::SqlConnectionPool& connectionPool)
>
> : connectionPool_(connectionPool),
>
> users_(*this)
>
> {
>
> setConnectionPool(connectionPool_);
>
> mapClass<Comment>("comment");
>
> mapClass<Post>("post");
>
>
>
> The way I used mapClass before, I preceded it with the session created by the
> connection, but here is seems like setConnectionPool creates a
> connection/session for the method, but is it then owned by users_(*this) <-I
> assume this is the user that logs on his blog and so on. The issue I run into
> is that I dont have any users defined, the application is not going to allow
> more than one user to access the db simultaneously (this is defined in the
> specification of its functionality). And I have a feeling that the binding of
> users_(*this) is part of defining the connection. Im sorry I dont have more
> experience with c++, but Im trying hard. When I remove users_(*this), I get
> errors that both setConnectionPool and mapClass are undeclared identifiers.
> But Ive used session.mapClass previous in my methods in the same class... How
> do I do this? I understand that I need to somehow append session to the whole
> class, dont I?
>
>
BlogSession specializes Dbo::Session and thus mapClass<Post>("post") is the
same as this->mapClass<Post>("post"). That's what you were overlooking? To
brush up your C++ you are probably best of taking a C++ book at hand.
Regards,
koen
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest