[RMI-JDBC Performance]

View: New views
2 Messages — Rating Filter:   Alert me  

[RMI-JDBC Performance]

by Ronye Vernaes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I'm trying to use RMI-JDBC... But I compared against other MS Access JDBC solutions (like Atinav Driver and Server: http://www.aveconnect.com/) and RMI-JDBC is 15x slower!!!

A query with 4674 rows delays 15398 milis, while the same query delays 1098 milis with Atinav Driver...

Is my mistake? Did I forget configure something? Can we optimize the response time? Is a comercial restriction?

--
Ronye M. Vernaes K.
"La flexibilidad es el más elevado de los Principios"

--
You receive this message as a subscriber of the rmijdbc@... mailing list.
To unsubscribe: mailto:rmijdbc-unsubscribe@...
For general help: mailto:sympa@...?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

Re: [RMI-JDBC Performance]

by Pierre-Yves Gibello :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ronye Vernaes a écrit :
> Hi, I'm trying to use RMI-JDBC... But I compared against other MS
> Access JDBC solutions (like Atinav Driver and Server:
> http://www.aveconnect.com/) and RMI-JDBC is 15x slower!!!
>
Each method call in RmiJdbc is a remote call, so RmiJdbc is not
optimized for performance (it is because "La flexibilidad es el más
elevado de los Principios", as you say in your mail signature - y es mas
elevado que la velocidad).
> Is my mistake? Did I forget configure something? Can we optimize the
> response time? Is a comercial restriction?
Not a commercial restriction (because I never heard of anyone making
money by selling RmiJdbc), but a restriction that can be turned around,
as follows :

In RJStatementServer.java, add the following :

import javax.sql.rowset.CachedRowSet;
import com.sun.rowset.CachedRowSetImpl;

// ...

  public CachedRowSet executeCachedQuery(String sql)
  throws java.rmi.RemoteException, SQLException {
          CachedRowSetImpl crs = new CachedRowSetImpl();
          crs.populate(jdbcStatement_.executeQuery(sql));
          return crs;
  }

And also add the method declaration to RJStatementInterface.java :
import javax.sql.rowset.*;
//...
CachedRowSet executeCachedQuery(String sql) throws
java.rmi.RemoteException, SQLException;

Then modify executeQuery() in RJStatement.java as follows :

    public java.sql.ResultSet executeQuery(String sql) throws SQLException {
      try {
                  return rmiStatement_.executeCachedQuery(sql);
                  // return new
RJResultSet(rmiStatement_.executeQuery(sql), this);
      } catch(RemoteException e) {
        throw new java.sql.SQLException(e.getMessage());
      }
    }


The tip was posted some time ago by a contributor named Barry Kreiser,
thanks to him.

The problem is that it uses com.sun... classes, so it can only work with
a Sun JDK. It is also not totally generic (eg. if your rowset contains
non serializable items, I'm afraid its behaviour can be unpredictable).

But it should work fine in most cases !

Regards,
 Pierre-Yves Gibello - ExperLog




--
You receive this message as a subscriber of the rmijdbc@... mailing list.
To unsubscribe: mailto:rmijdbc-unsubscribe@...
For general help: mailto:sympa@...?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
LightInTheBox - Buy quality products at wholesale price!