Hey koen, I did try this->mapClass… and *this->mapClass first, because that would be natural if the class is itself the «session». It didn’t change the error message even. Im not sure if Ive identified all thats going on in setting up the connectionPool and how its used yet. It is a bit more complicated in the blog example as I assume you would share the connection between several bloggers, while I only want to make a connection that I send to some methods one at a time, because they are writing data to 5 tables in the database. I just preferably dont want to pass all the login parameters every time I want to post a new data set to the database, as it is time consuming and not good practice.
If I go back to the original code I pasted on here and change session.setConnection to session.setConnectionPool, the pass a pointer to the session instead the session as a value…. would that be possible? Id love to have a simpler example for my usage than the blog example, not that its so complex, but there are a whole lot of different classes and headers to switch between on 13 inches ;) Yeah, I have a couple of books available and use cplusplus.com and google for reference, unfortunately you dont have that many users of Wt yet, so that narrows down the possible sources of information a bit, but I really like the idea of Wt and feel like Im starting to grasp c++, so Ill continue using it. Regards, Tor 21. mars 2014 kl. 12:12 skrev Koen Deforche <k...@emweb.be>: > 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
signature.asc
Description: Message signed with OpenPGP using GPGMail
------------------------------------------------------------------------------ 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