Jed Glazner wrote:
I'm trying to connect to a 2nd external database (not opentaps) where I only have read only rights. It's an adserver that powers the ads on our site.
We only have read permissions and can't alter the tables at all. our normal opentaps databse uses postgres, but the adserver uses MySQL.
What i've tried is to create a new datasource in the
framework/entity/config/entityengine.xml.
I then wrote a service which uses the ConnectionFactory class. The problem is
that I get a Java Heap Space error the first time the service runs.
After that the service will run succesfully without any errors, until the next time ofbiz get started, then I get the heap space error once, and then it works fine again.
I don't want to do just strait JDBC becauseI want to take advantage of the connection pooling within opentaps.
Jed,
It looks to me like you're doing things the hard way. It would be simpler to use the Entity Engine
to gain access to the other database.
1. Create entity definitions for the external database like you would for an OFBiz entity (except
use the no-auto-stamp="true" attribute).
2. Assign the entities to a different group (in entitygroup.xml), "advertpro"
for example.
3. Assign the "mysql-advertpro" datasource the the default delegator:
<group-map group-name="advertpro" datasource-name="mysql-advertpro"/>
4. Use the delegator to access the external database.
-Adrian