Hi, we are developing an e-learning platform based on Cocoon. But since most of my problem has to do with Excalibur, I decided I'd better post here.
Part of that e-learning platform is an upload mechanism that allows authors to feed new documents to our system. These documents go into a PostgreSQL (7.3.2) database. However, documents may not only be text objects (with them, everything works fine). They also may be very large binary objects, such as images, sounds, movies, applets, etc. As suggested in the PostgreSQL documentation, I want to use the LargeObject API to store them, cf. http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=jdbc-binary-data.html To do so, I have to get a reference to the LargeObject API from a PostgreSQL connection object, i.e. a subclass of org.postgresql.PGConnection. IOW: I need some kind of reference to that PostgreSQL connection object. This is where I'm stuck right now. The core class of my database access layer implements (among other things) the Startable interface. Thus, the connection to the Postgres database is obtained from the component manager in the start() method. If you think the code of the start() method could help you understand what I'm talking about, please let me know. Now, when I start my system, the Connection object I get from the ResourceLimitingPool is an instance of a class named '$Proxy0'. From the documentation available (including mail archives), all I can tell is that this is some kind of wrapper around the actual Connection object. However, there doesn't seem to be any method which lets me access that connection object. Or is there? I already tried 'getConnection()' -- that, again, returned a '$Proxy0' object. Of course, casting that connection object to PGConnection threw a class cast exception. I tried to set the connection class to be used in the datasource configuration (using the 'connection-class' attribute of the 'pool-controller' tag). That didn't work, either, since the class given there is expected to have a constructor with two parameters (the actual connection plus the "keep alive" query) -- which the original PostgreSQL classes don't. Before I forget, my environment: * Cocoon 2.0.4 with all the Avalon stuff bundled with it _except_ that I replaced excalibur-datasource-vm14-20021121.jar with excalibur-datasource-1.1.1.jar because AFAIS the getConnection() methods in the various JdbcConnection classes were protected before 1.1.1 * JDK 1.4.2 * Tomcat 4.1.24 * JDBC driver for PostgreSQL 7.3.2 * SuSE Linux 8.0, but that shouldn't matter... BTW: basically, my problem seems to be quite the same as the one reported on the PostgreSQL JDBC list, in the thread starting at: http://archives.postgresql.org/pgsql-jdbc/2003-01/msg00032.php The only difference seems to be that I'm using an Avalon connection pool. Is there a similar solution? Do I have to... * ...write my own PostgreSQLDataSource class? * ...write my own PostgreSQLJdbcConnection (extending AbstractJdbcConnection) -- then how do I make this class use some PostgreSQL connection class (and not '$Proxy0')? * ...configure the Excalibur Datasources package somewhere else to make it use a PostgreSQL JDBC connection internally? All suggestions on what to try next are welcome. TIA, Uwe -- Dipl.-Inform. Uwe Sinha | Technische Universit�t Berlin, E-Mail: [EMAIL PROTECTED] | Fakult�t II, Institut f�r Mathematik, Raum MA701, Tel. (030) 314-22698 | Sekr. MA 7-2 Projekt MUMIE http://www.mumie.net | Str. des 17. Juni 136, D-10623 Berlin --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
