summaryrefslogtreecommitdiff
path: root/dbaccess/source/core
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
commit3f0f14195bec2fd4966b3535898fd0cc1010eb14 (patch)
treede0aca196d8ce2497c430ffbf33af5299473d83f /dbaccess/source/core
parentffc31d312f2ca542c81c2d030071218a72be7188 (diff)
dba34d: #i108967# introduce new settings into UI and driver config: RespectDriverResultSetType
Diffstat (limited to 'dbaccess/source/core')
-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 9963d2ad6..2a5384243 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) &&