[Registry-dev] extensible searching API
Sanjiva Weerawarana
sanjiva at wso2.com
Thu Sep 13 11:04:29 PDT 2007
What about using RowSet in the API? If the underlying thing has a
CachedRowSet that's cool but we just stick to RowSet.
Sanjiva.
Chathura C. Ekanayake wrote:
>
> There is a problem in returning a ResultSet object in executeQuery(...)
> method.
> ResultSets cannot be accessed after the jdbc connection used for
> retrieving the ResultSet is closed.
>
> AFAIK although we use pooled connections, we can't guarantee that the
> connections will not be closed.
> Connection pool implementations may close connections after it has
> reached some threshold connection count.
>
> The solution for disconnected database result access is CachedRowSet
> interface, which is only available in java 1.5.
> And even in java 1.5, there is no standard impl of that interface.
>
> I think there are two solutions for this problem.
>
> 1) Add a java.sql.Connection object as a parameter to the executeQuery
> method. Then the caller of the method is
> responsible for closing the connection (or giving the connection back to
> the pool).
>
> 2) Create an in-memory table to hold the data of the ResultSet and
> return it.
>
> Comments ...
>
> Thanks,
> Chathura
>
> Sanjiva Weerawarana wrote:
>> Here's a proposal for adding extensible searching to the registry:
>>
>> void defineQuery (String name, String query)
>> ResultSet executeQuery (String name, Object[] params)
>>
>> So one can define a query and then later execute it.
>>
>> Obviously the person writing the query needs to understand the
>> relational data model that we're using; thus effectively we need
>> document that as part of the "API" of the registry.
>>
>> Thoughts?
>>
>> Sanjiva.
>
>
--
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
email: sanjiva at wso2.com; cell: +94 77 787 6880; fax: +1 509 691 2000
"Oxygenating the Web Service Platform."
More information about the Registry-dev
mailing list