Eric,

This is what I did:
1. setup a new data source. Below is the result (taken from
jrun-resources.xml):
--------------------------------------
<data-source>
  <dbname>M2M_TEST_DS</dbname>
  <driver>oracle.jdbc.driver.OracleDriver</driver>
  <url>jdbc:oracle:oci8:@isis</url>
  <username>m2m</username>
  <password>A573316D0B3B2DE9C3F46D8B6AB5D6D2</password>
  <encrypted>true</encrypted>
  <encryption-class>jrun.security.JRunCrypterForTwofish</encryption-class>
  <native-results>false</native-results>
  <remove-on-exceptions>true</remove-on-exceptions>
  <pool-statements>true</pool-statements>
  <initial-connections>1</initial-connections>
  <connection-timeout>1200</connection-timeout>
  <transaction-timeout>20</transaction-timeout>
  <cache-enabled>false</cache-enabled>
  <cache-size>5</cache-size>
  <cache-refresh-interval>30</cache-refresh-interval>
  <jndi-name>M2M_TEST_DS</jndi-name>
  <poolname>Pool</poolname>
  <minimum-size>0</minimum-size>
  <maximum-size>2147483647</maximum-size>
  <user-timeout>20</user-timeout>
  <skimmer-frequency>420</skimmer-frequency>
  <shrink-by>5</shrink-by>
  <maximum-soft>true</maximum-soft>
  <debugging>false</debugging>
  <disable-pooling>false</disable-pooling>
<description />
</data-source>
--------------------------------------

2. created a test jsp file:
--------------------------------------
<%
  try {
    String jndiName = "M2M_TEST_DS";
    InitialContext _context = new InitialContext();   
    DataSource ds = (DataSource) _context.lookup(jndiName); // bind jndiName
//    msg = ds.getClass().getName();   --> this one returns
"jrun.sql.JRunDataSource"
    Connection conn = ds.getConnection();
    OracleCallableStatement ocs = (OracleCallableStatement)
conn.prepareCall("xxx");
    msg = ocs.getClass().getName();
%>
msg = <%=msg%>
<%
  } catch(Exception e) {
%>
  <pre><%e.printStackTrace(new PrintWriter(out));%></pre>
<%
  }
%>
--------------------------------------

.. and this was the result:
--------------------------------------
java.lang.ClassCastException: jrun.sql.JRunCallableStatement
        at jrun__test12ejspa._jspService(jrun__test12ejspa.java:75)
        at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
        at jrun.jsp.JSPServlet.service(JSPServlet.java:106)
        at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
        at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
        at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241)
        at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
        at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
        at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:
348)
        at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451
)
        at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:29
4)
        at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
--------------------------------------

Eric, did I make mistakes somewhere?

regards,

Budi



> -----Original Message-----
> From: Eric Anderson [  <mailto:[EMAIL PROTECTED]>
mailto:[EMAIL PROTECTED]]
> Sent: 25 July 2002 19:17
> To: JRun-Talk
> Subject: RE: ClassCastException: jrun.sql.JRunResultSet
>
>
> When you configure a JDBC data source in JRun 4 you have the
> option of classifying it as a "native" result set or a
> non-native" result set.  Native result sets return a
> JRunResultSet that allows the use of cacheable, scrollable
> and updateable result set.  If you use a non-native result
> set you are returned a result set of the underlying JDBC
> driver.  If you are using the DataDirect driver and try to
> caste a DataDirect result set as a OracleResult set this
> could cause your problem. 
>
> There are a couple of things you can do to work around this
> behavior.  First, (as Budi mentions) bind an data source in
> JNDI using the Oracle JDBC driver or Oracle connection pool. 
> Note, if any connection pooling was being implemented here it
> would be Oracle's connection pooling not JRun's.  This has
> the effect of only being able to return an OracleResult set
> since the DataDirect driver is not being used.  Second, try
> using the Oracle JDBC driver with the JRun connection pool
> (not the DataDirect driver that we ship with JRun 4).  If you
> do this you will want to set the XML descriptor
> <native-results>false</native-results> in the
> jrun-resources.xml.  This will make sure you are returning an
> OracleResult set from the Oracle JDBC driver.  Lastly, you
> could modify your JDBC code so that you
> do not caste the result set as an OracleResult set.
>
> Post back to the list and let us know if this helps.
>
> Thanks
>
> Eric
>
> JRun Support
> Macromedia Inc.



______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to