DF 2.1.2 problem with Oracle connection


#1

After completing the update to DF 2.1.2 (from Linux source), our Oracle connection now generates the following errors:

[2016-05-10 17:19:36] production.ERROR: * System error building event map for service ‘system’.
Service configuration class name lookup failed for resource DreamFactory\Core\Resources\System\Setting
[2016-05-10 17:19:36] production.ERROR: * System error building event map for service ‘hra15dev’.
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

The service and connection string was working properly with DF 2.1.1.


#2

The problem is in the new source code for SqlDb.php and is caused when you use a SERVICE_NAME rather than SID for Oracle.

In particular, we use a SERVICE NAME and not SID for our Oracle connection… like this:

oci:dbname=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME= )))

In the source code of df-sqldb\src\Services\SqlDb.php is the following:

00147: if (!isset($config[‘database’]) && (false !== ($pos = stripos($dsn, ‘sid=’)))) {
00148: $temp = substr($dsn, $pos + 4);
00149: $config[‘database’] = (false !== $pos = stripos($temp, ‘)’)) ? substr($temp, 0, $pos) : $temp;
00150: }

Note that it only handles sid and not service_name… if the code is changed to handle both sid and service_name the connection will work.