Hello, after your post I would open/close my db within each service call.
If I would do it with a pool, I would need 2 entry points, one to open the pool and one to close it. If I would go this way, would these entry point exist (is there a deinit)? Thanks Magnus On 20 Jun., 15:58, roji <[email protected]> wrote: > Hi Magnus. > > Your server-side service implementation is a class that extends GWT's > RemoteServiceServlet, which itself extends the Servlet interface. If > you need to perform once-only initialization, you can do so by > overriding the init() method in your class. > > Note, however, that init() is probably a bad place to open database > connections, as your backend will be accessed concurrently by many > users and multiple database connections are needed. You should > probably either open and close database connections inside the RPC > service calls themselves (using a database connection pool behind the > scenes), or in some scenarios store some resources in the user's HTTP > session (acquired by calling > this.getThreadLocalRequest().getSession()). > > If you need more help, can you send more details about your > application? > > Shay > > On Jun 20, 5:23 am, Magnus <[email protected]> wrote: > > > > > Hi, > > > I wonder where to open and close the database on the server side, and > > where to store the database connection. > > > At this point, I only have the server side implementation of my RPC > > services. But there is no place to store my Connection object and no > > entry point like "onServerLoad" or something like that. > > > An alternative way would be to open and close the database on each > > service call. > > > How do you do this? > > > Thank you > > Magnus- Zitierten Text ausblenden - > > - Zitierten Text anzeigen - -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
