RE: Pooled Data Source ADDENDUM! Design question for you :)

2001-01-30 Thread Daniel Cardin

I think I have not made myself clear enough. The DataSource access works
in the
context of the appserver running. What I was trying to do is access a
DataSource 
from the application client side. Now, this is the fix for my problem,
but maybe 
there is a better way to resolve this, so I will explain what I'm trying
to 
accomplish on the client side. 

I have many requests to the database that return a high number of rows
to be 
displayed in the client application. Now, my current framework allows me
to build
portable data object and transmit them accross the wire, but you will
surely 
agree with me that building 1 objects and serializing them is NOT
efficient.

I have then tried using the new CachedRowSet object from Sun on the
server side 
and returning (serializing) the ResultSet directly to the client app.
But this 
process is _still_ very long as the serialization of so many records is 
very expensive. (ie about 10 seconds, versus less than one second with a
local
connection object, vs about 500 ms with an ADO.RecordSet)

I thus get very good performance if I open up the ResultSet on the
client side, but
this is something I wanted to avoid. In the very least I figured that if
I could 
get a connection from the server connection pool, I could build up the
SQL request
on the server and execute it blindly on the client through a generic
mechanism. 

So, I ask you, what should I do to access large number of rows ? 

And is it possible to use a DataSource from the application client when
the beans
are deployed as CMP beans ?

Thanks!

Daniel

-Message d'origine-
De : Daniel Cardin 
Envoy : 29 janvier, 2001 11:08
 : Orion-Interest
Objet : Pooled Data Source


Well... it seems I just can't make it work, even though I have read just
about all the messages on the subject.

datasources :

data-source
class="com.evermind.sql.DriverManagerDataSource"
name="ddsNP"
location="jdbc/ddsNP"
xa-location="jdbc/xa/ddsXANP"
ejb-location="jdbc/ddsNP"
connection-driver="com.inet.tds.TdsDriver"
username="sa"
password=""
url="jdbc:inetdae7:theserver:1433?database=test"
inactivity-timeout="30"
schema="database-schemas\ms-sql.xml"
/
data-source
class="com.evermind.sql.OrionPooledDataSource"
name="dds"
location="jdbc/ddsDS"
xa-location="jdbc/xa/ddsXADS"
ejb-location="jdbc/ddsDS"
max-connections="2"
source-location="jdbc/ddsNP"
pooled-location="jdbc/ddsDS"
username="sa"
password=""   
inactivity-timeout="30"
   connection-driver="com.inet.tds.TdsDriver"
   url="jdbc:inetdae7:theserver:1433?database=test"
   /

the code

  DataSource ds = (DataSource)ctx.lookup("jdbc/ddsNP"); // have used
jdbc/ddsDS as well...

the lookup returns an OrionCMTDataSource

but the call to getConnection() 

  DatabaseMetaData dmd = ds.getConnection().getMetaData();

raises :

java.lang.NullPointerException
at com.evermind.sql.OrionPooledDataSource.d8(JAX)
at com.evermind.sql.ak.eo(JAX)
at com.evermind.sql.ak.ep(JAX)
at com.evermind.sql.ap.getMetaData(JAX)
at dds_testclient.Frame1.dsTest(Frame1.java:81)

Hints anyone ? 

Thanks!

Daniel







RE: Pooled Data Source ADDENDUM! Design question for you :)

2001-01-30 Thread Juan Lorandi (Chile)

paginate your search and cache partial results on the client side:

you need N total records...

have a query to return J records starting at page K
(records between K*J and (K+1)*J)

cache these on the client for page 1
whenever a given page K is shown, check in the cache if pages (K-1)
(previous) and (K+1) (next) are available on the
cache, else load from the server.

HTH

JP

-Original Message-
From: Daniel Cardin [mailto:[EMAIL PROTECTED]]
Sent: Martes, 30 de Enero de 2001 11:54
To: Orion-Interest
Subject: RE: Pooled Data Source ADDENDUM! Design question for you :)


I think I have not made myself clear enough. The DataSource access works
in the
context of the appserver running. What I was trying to do is access a
DataSource 
from the application client side. Now, this is the fix for my problem,
but maybe 
there is a better way to resolve this, so I will explain what I'm trying
to 
accomplish on the client side. 

I have many requests to the database that return a high number of rows
to be 
displayed in the client application. Now, my current framework allows me
to build
portable data object and transmit them accross the wire, but you will
surely 
agree with me that building 1 objects and serializing them is NOT
efficient.

I have then tried using the new CachedRowSet object from Sun on the
server side 
and returning (serializing) the ResultSet directly to the client app.
But this 
process is _still_ very long as the serialization of so many records is 
very expensive. (ie about 10 seconds, versus less than one second with a
local
connection object, vs about 500 ms with an ADO.RecordSet)

I thus get very good performance if I open up the ResultSet on the
client side, but
this is something I wanted to avoid. In the very least I figured that if
I could 
get a connection from the server connection pool, I could build up the
SQL request
on the server and execute it blindly on the client through a generic
mechanism. 

So, I ask you, what should I do to access large number of rows ? 

And is it possible to use a DataSource from the application client when
the beans
are deployed as CMP beans ?

Thanks!

Daniel

-Message d'origine-
De : Daniel Cardin 
Envoy : 29 janvier, 2001 11:08
 : Orion-Interest
Objet : Pooled Data Source


Well... it seems I just can't make it work, even though I have read just
about all the messages on the subject.

datasources :

data-source
class="com.evermind.sql.DriverManagerDataSource"
name="ddsNP"
location="jdbc/ddsNP"
xa-location="jdbc/xa/ddsXANP"
ejb-location="jdbc/ddsNP"
connection-driver="com.inet.tds.TdsDriver"
username="sa"
password=""
url="jdbc:inetdae7:theserver:1433?database=test"
inactivity-timeout="30"
schema="database-schemas\ms-sql.xml"
/
data-source
class="com.evermind.sql.OrionPooledDataSource"
name="dds"
location="jdbc/ddsDS"
xa-location="jdbc/xa/ddsXADS"
ejb-location="jdbc/ddsDS"
max-connections="2"
source-location="jdbc/ddsNP"
pooled-location="jdbc/ddsDS"
username="sa"
password=""   
inactivity-timeout="30"
   connection-driver="com.inet.tds.TdsDriver"
   url="jdbc:inetdae7:theserver:1433?database=test"
   /

the code

  DataSource ds = (DataSource)ctx.lookup("jdbc/ddsNP"); // have used
jdbc/ddsDS as well...

the lookup returns an OrionCMTDataSource

but the call to getConnection() 

  DatabaseMetaData dmd = ds.getConnection().getMetaData();

raises :

java.lang.NullPointerException
at com.evermind.sql.OrionPooledDataSource.d8(JAX)
at com.evermind.sql.ak.eo(JAX)
at com.evermind.sql.ak.ep(JAX)
at com.evermind.sql.ap.getMetaData(JAX)
at dds_testclient.Frame1.dsTest(Frame1.java:81)

Hints anyone ? 

Thanks!

Daniel