[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - connectivity/source

Lionel Elie Mamane lionel at mamane.lu
Wed Jan 8 07:19:35 PST 2014


 connectivity/source/drivers/jdbc/CallableStatement.cxx |    4 ++++
 connectivity/source/drivers/jdbc/PreparedStatement.cxx |    5 +++++
 2 files changed, 9 insertions(+)

New commits:
commit 85cf6f6f210eaf427ff91d59325122eb7a4e54d1
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Mon Jan 6 16:40:59 2014 +0100

    fdo#37167 create statement before execute/wasNull/getBoolean
    
    This populates "object" member variable.
    
    The "createStatement" calls were removed in:
    
     commit b9392a36645d8632b97ad79240f483b3a1683b61
     Author: Ivo Hinkelmann <ihi at openoffice.org>
     Date:   Thu Apr 23 10:42:05 2009 +0000
    
        CWS-TOOLING: integrate CWS dbaperf1
    
    This was most probably in error since the call is not removed from the
    other modified member functions in this commit and/or failed to
    aaccount for the scenario of no parameter (and thus no setXXX call
    before execute).
    
    Change-Id: Ic0e7b7b64ea496791f32c1416aa7d4416f909616
    Reviewed-on: https://gerrit.libreoffice.org/7281
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/connectivity/source/drivers/jdbc/CallableStatement.cxx b/connectivity/source/drivers/jdbc/CallableStatement.cxx
index 7ab349f..50cce64 100644
--- a/connectivity/source/drivers/jdbc/CallableStatement.cxx
+++ b/connectivity/source/drivers/jdbc/CallableStatement.cxx
@@ -69,12 +69,16 @@ Any SAL_CALL java_sql_CallableStatement::queryInterface( const Type & rType ) th
 // -------------------------------------------------------------------------
 sal_Bool SAL_CALL java_sql_CallableStatement::wasNull(  ) throw(starsdbc::SQLException, RuntimeException)
 {
+    SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
+    createStatement(t.pEnv);
     static jmethodID mID(NULL);
     return callBooleanMethod( "wasNull", mID );
 }
 
 sal_Bool SAL_CALL java_sql_CallableStatement::getBoolean( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException)
 {
+    SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
+    createStatement(t.pEnv);
     static jmethodID mID(NULL);
     return callBooleanMethodWithIntArg( "getBoolean", mID,columnIndex );
 }
diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
index 59a4b29..774d130 100644
--- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx
+++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx
@@ -96,6 +96,8 @@ sal_Bool SAL_CALL java_sql_PreparedStatement::execute(  ) throw(::com::sun::star
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
 
+    SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
+    createStatement(t.pEnv);
     static jmethodID mID(NULL);
     return callBooleanMethod( "execute", mID );
 }
@@ -106,6 +108,9 @@ sal_Int32 SAL_CALL java_sql_PreparedStatement::executeUpdate(  ) throw(::com::su
     ::osl::MutexGuard aGuard( m_aMutex );
     checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed);
     m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTING_PREPARED_UPDATE );
+
+    SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
+    createStatement(t.pEnv);
     static jmethodID mID(NULL);
     return callIntMethod("executeUpdate",mID);
 }


More information about the Libreoffice-commits mailing list