Thread: Jboss and largeObjectManager
I am using Jbos 4.0 and postgresql 7.3 as database. As datasource I have pooled connection (local-tx-datasource). As long as I do not work with large object it seems to be fine. But how do get an instance of the LargeObjectManager. When I try to do LargeObjectManager lobj = ((org.postgresql.PGConnection) dbcon).getLargeObjectAPI(); I get the error java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrappedConnection I hope someone can help me. Best regards Torben Froeberg
On Wednesday 08 June 2005 14:21, torben wrote: > LargeObjectManager lobj = ((org.postgresql.PGConnection) dbcon).getLargeObjectAPI(); > > I get the error java.lang.ClassCastException: > org.jboss.resource.adapter.jdbc.WrappedConnection I'm not a JBoss programmer, but looking at the JBoss Javadoc at http://docs.jboss.org/jbossas/javadoc/4.0.2/org/jboss/resource/adapter/jdbc/WrappedConnection.html#getUnderlyingConnection%28%29 it seems to me that what you want to do is LargeObjectManager lobj = ((org.postgresql.PGConnection) dbcon.getUnderlyingConnection()).getLargeObjectAPI(); (As a side note, this question should've been directed to some JBoss-specific list.)
Vadim Nasardinov wrote: >On Wednesday 08 June 2005 14:21, torben wrote: > > >>LargeObjectManager lobj = ((org.postgresql.PGConnection) dbcon).getLargeObjectAPI(); >> >>I get the error java.lang.ClassCastException: >>org.jboss.resource.adapter.jdbc.WrappedConnection >> >> > >I'm not a JBoss programmer, but looking at the JBoss Javadoc at > >http://docs.jboss.org/jbossas/javadoc/4.0.2/org/jboss/resource/adapter/jdbc/WrappedConnection.html#getUnderlyingConnection%28%29 > >it seems to me that what you want to do is > > LargeObjectManager lobj = > ((org.postgresql.PGConnection) dbcon.getUnderlyingConnection()).getLargeObjectAPI(); > > > Thank's very much. It was exactly what I needed. >(As a side note, this question should've been directed to some JBoss-specific >list.) > > Yes, I can see it now it was the wrong list.