<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed Jun 19 17:31:42 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DBAL-60/DBAL-60.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DBAL-60] OCI8Connection couldn&apos;t connect when charset parameter specified</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-60</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>
&lt;p&gt;When I am trying to connect to Oracle instance with another charset then specified in my environment variable NLS_LANG I got an error.&lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$connectionOptions[&apos;oracle&apos;] = array(
    &apos;driver&apos; =&amp;gt; &apos;oci8&apos;,
    &apos;dbname&apos; =&amp;gt; &apos;BOOK&apos;,
    &apos;user&apos; =&amp;gt; &apos;doctrine&apos;,
    &apos;password&apos; =&amp;gt; &apos;doctrine&apos;,
    &apos;charset&apos; =&amp;gt; &apos;AL32UTF8&apos;,
);

$em = EntityManager::create($connectionOptions[&apos;oracle&apos;], $config, $evm);
$em-&amp;gt;getConnection()-&amp;gt;connect();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Produce error messages:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;PHP Warning:  oci_error() expects parameter 1 to be resource, boolean given in /www/test/doctrine2/vendor/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php on line 149&lt;br/&gt;
PHP Fatal error:  Uncaught exception &apos;Doctrine\DBAL\Driver\OCI8\OCI8Exception&apos; in /www/test/doctrine2/vendor/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php:42&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;There is bug in OCI8Connection::errorInfo() and ::errorCode(). When oci_connect failed, it returns a boolean - false. but oci_error() accepts only resource as parameter. Therefor it is neccessary to check, whether $this-&amp;gt;_dbh is resource.&lt;/p&gt;

&lt;p&gt;When I&apos;ve fixed the error handling, I&apos;ve got the right error, why I couldn&apos;t connect to Oracle:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;PHP Fatal error:  Uncaught exception &apos;Doctrine\DBAL\Driver\OCI8\OCI8Exception&apos; with message &apos;ORA-12154: TNS:could not resolve the connect identifier specified&apos; in /www/test/doctrine2/vendor/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php:28&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;That&apos;s because oci_connect accepts as connection string only TNS name, or Oracle Connection string. But &lt;tt&gt;;charset=*&lt;/tt&gt; in TNS name or connection string is invalid. oci_connect has 4th parameter charset for that purpose.&lt;/p&gt;</description>
                <environment>PHP Version 5.3.3-1ubuntu9, OCI8 1.4.1, Oracle 10.2.0.4.0</environment>
            <key id="12083">DBAL-60</key>
            <summary>OCI8Connection couldn&apos;t connect when charset parameter specified</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="adrive">Miloslav &quot;adrive&quot; Kmet</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Nov 2010 04:02:34 +0000</created>
                <updated>Sat, 29 Dec 2012 17:43:09 +0000</updated>
                    <resolved>Thu, 11 Nov 2010 14:36:01 +0000</resolved>
                            <version>2.0.0-BETA4</version>
                                <fixVersion>2.0.0-RC1-RC3</fixVersion>
                                <component>Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14688" author="adrive" created="Tue, 9 Nov 2010 04:11:09 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;https://github.com/milokmet/dbal/tree/DBAL-60&quot; class=&quot;external-link&quot;&gt;https://github.com/milokmet/dbal/tree/DBAL-60&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14722" author="beberlei" created="Thu, 11 Nov 2010 14:36:01 +0000"  >&lt;p&gt;Fixed&lt;/p&gt;</comment>
                    <comment id="19192" author="userua" created="Sat, 29 Dec 2012 12:56:47 +0000"  >&lt;p&gt;Can you help me. I&apos;m having same problem. But your link doesn&apos;t work.&lt;/p&gt;</comment>
                    <comment id="19194" author="adrive" created="Sat, 29 Dec 2012 17:43:09 +0000"  >&lt;p&gt;You must have very old source code. The bug was fixed 2 years ago. Just compare your OCI8 driver with &lt;a href=&quot;https://github.com/doctrine/dbal/tree/master/lib/Doctrine/DBAL/Driver/OCI8&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/tree/master/lib/Doctrine/DBAL/Driver/OCI8&lt;/a&gt;&lt;/p&gt;
</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>