summaryrefslogtreecommitdiff
path: root/dbaccess/source/core/api/RowSetCache.cxx
diff options
context:
space:
mode:
authorOcke.Janssen <Ocke.Janssen@oracle.com>2011-01-26 12:26:48 +0100
committerOcke.Janssen <Ocke.Janssen@oracle.com>2011-01-26 12:26:48 +0100
commita6f0350550d96ba8e00e79325a260a63a5899107 (patch)
tree803105157db5910578275773cc1f7f85829b03f6 /dbaccess/source/core/api/RowSetCache.cxx
parent984a233417d1ceb056abeeb6b7f4765c793d5566 (diff)
dba34d: #i108967# introduce new settings into UI and driver config: RespectDriverResultSetType
Diffstat (limited to 'dbaccess/source/core/api/RowSetCache.cxx')
-rw-r--r--dbaccess/source/core/api/RowSetCache.cxx18
1 files changed, 13 insertions, 5 deletions
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index 2d4355edcaef..7401a1016e53 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -116,11 +116,11 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
DBG_CTOR(ORowSetCache,NULL);
// first try if the result can be used to do inserts and updates
+ Reference< XPropertySet> xProp(_xRs,UNO_QUERY);
+ Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo();
try
{
Reference< XResultSetUpdate> xUp(_xRs,UNO_QUERY_THROW);
- Reference< XPropertySet> xProp(_xRs,UNO_QUERY);
- Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo();
sal_Bool bBookmarkable = xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) &&
any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is();
if ( bBookmarkable )
@@ -139,14 +139,22 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
{
(void)ex;
}
- _xRs->beforeFirst();
+ try
+ {
+ if ( xPropInfo->hasPropertyByName(PROPERTY_RESULTSETTYPE) &&
+ ::comphelper::getINT32(xProp->getPropertyValue(PROPERTY_RESULTSETTYPE)) != ResultSetType::FORWARD_ONLY)
+ _xRs->beforeFirst();
+ }
+ catch(const SQLException& e)
+ {
+ (void)e;
+ }
// check if all keys of the updateable table are fetched
sal_Bool bAllKeysFound = sal_False;
sal_Int32 nTablesCount = 0;
- Reference< XPropertySet> xProp(_xRs,UNO_QUERY);
- Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo();
+
sal_Bool bNeedKeySet = !(xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) &&
any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is() );
bNeedKeySet = bNeedKeySet || (xPropInfo->hasPropertyByName(PROPERTY_RESULTSETCONCURRENCY) &&