Hello, I am new to Mahout. I am using it to get recommendations out of my data stored in a MySQL database. I have started by configuring the DataSource programmatically, and followed the performace hints in the JavaDoc for MySQLJDBCDataModel. But without connection pooling the performance is with just 3000 preferences extremely bad.
I am using Tomcat and I have done the configuration as described here: http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-j2ee.html, under 20.3.5.2.2. Using Connector/J with Tomcat My Web.xml: <resource-ref> <res-ref-name>jdbc/ MySQLDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> In the context.xml I have done the same configuration as described under point 20.3.5.2.2. Using Connector/J with Tomcat (see link above) The usual way for retrieving the DataSource via JNDI doesn’t work for me, since Mahout requires a MySQLJDBCDataModel. The following cast doesn’t work: InitialContext ctx = new InitialContext(); dataSource = (MysqlDataSource)ctx.lookup( “java:comp/env/jdbc/MySQLDB"); ERROR: java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to com.mysql.jdbc.jdbc2.optional.MysqlDataSource What is the correct way to retrieve the datasource via JNDI and use pooling? Thank you.
