Hi all,

I'm having a lot of fun trying to convert my code to 2.1.7. There is still a lot of things I didn`t figured out yet.

Can you please tell me how to convert the following function.?

public final List getList(DbConnection dbCon, String mapKey, Object param) throws DatabaseException {

       List list = null;
       boolean handleTransactionLocally = false;
       try {
           if (dbCon == null) {
               handleTransactionLocally = true;
               dbCon = connectionFactory.getConnection();
               dbCon.setReadOnlyConnection(true);
           }

           MappedStatement statement = sqlMap.getMappedStatement(mapKey);
list = statement.executeQueryForList(dbCon.getConnection(), param);
       } catch (SQLException e) {
//            log.error("Error during sql: " + e.getMessage(), e);
ExceptionAdaptor.instance(exceptionAdaptorKey).getMappedException(e, "getList: " + e.getMessage(), true, ExceptionAdaptor.ACTION_SEARCH, param);
       } finally {
           if (dbCon != null) {
               dbCon.closeAll(handleTransactionLocally);
           }
       }
       return list;
   }



I saw a sqlMap.setUserConnection() but this method can be called by simultaneously so setting the connection in the sqlMap doesn`t make sense to me. There is probably something that I don`t understand!

Please help :-)

Best Regards.
/David
P.S.: Also I do need to get the SQL string from a map to play with it myself. I'm not there yet but I hope there a way to get it! Thanks




Reply via email to