View Single Post
  #3 (permalink)  
Old 09-03-2003
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 818
If I understand correctly, your snippet represents an Ice client that calls an Ice server to insert some data (100 rows) in a database.

Your server would be more scalable and easier to use if the database connections were not exposed to the clients. If possible (from a permission/security point of view), I would recommend to create a pool of connections in the server: each time a request arrives, the servant picks a connection from this pool.

You should also avoid lots of small "set" remote calls, since remote calls are not as fast as local calls. You could use batched one ways, but combining all your sets into insert parameters would be simpler.
You could end up with something as simple as:
TestPrx proxy = databaseProxy->insert(primaryKey, c1, c2, c3, c4);

Cheers,
Bernard
Reply With Quote