Has anyone had any success using Oracle LOB's on JBoss? I have persistantly had this 
problem up to and including 3.2.1 where I can insert LOB's just fine. But on update I 
get the dreaded ORA-01002: Fetch out of sequence. I am using JBoss3.2.1, Oracle 9i, 
and the 9i thin driver (ojbdc14_g.jar). Here a code snippet that persistantly fails:


        try {
            boolean big = cr.getCurveData().length() > 4000;

            if (!big) {
                stmt = factory.getSqlStatement("Curves", "Update", conn);
                stmt.setString(1, cr.getCurveData());
                stmt.setTimestamp(2, new Timestamp(new java.util.Date().getTime()));
                stmt.setInt(3, cr.getUserId());
                stmt.setInt(4, cr.getTopicId());
                stmt.setDate(5, new Date(cr.getMarketDay().getDate().getTime()));
                result = stmt.executeUpdate();
            } else {
                stmt = factory.getSqlStatement("Curves", "UpdateLarge", conn);
                stmt.setTimestamp(1, new Timestamp(new java.util.Date().getTime()));
                stmt.setInt(2, cr.getUserId());
                stmt.setInt(3, cr.getTopicId());
                stmt.setDate(4, new Date(cr.getMarketDay().getDate().getTime()));
                result = stmt.executeUpdate();

                if (result == 0) {
                    return result;
                }

                stmt = factory.getSqlStatement("Curves", "SelectUpdate", conn);
                stmt.setInt(1, cr.getTopicId());
                stmt.setDate(2, new Date(cr.getMarketDay().getDate().getTime()));
                OracleResultSet rs = (OracleResultSet) stmt.executeQuery();

                if (rs != null && rs.next()) {
                    rs.getCLOB(1).putString(1, cr.getCurveData());
                    rs.close();
                }

            }

            return result;
        } finally {

            try {

                if (stmt != null) {
                    stmt.close();
                }

            } catch (SQLException e) {
                logger.warn("Failed to close a SQL resource.", e);
            }

        }

The error, ORA-01002, is raised on the invocation of OracleResultSet rs = 
(OracleResultSet) stmt.executeQuery(). My understanding is that, as long as autocommit 
is false,  this should work. Since the connection is fetched from a connection pool 
managed by JBoss, this should be the case. Any clues as to why this does not work?

Karl



**********************************************************************
This e-mail contains privileged attorney-client communications and/or confidential 
information, and is only for the use by the intended recipient. Receipt by an 
unintended recipient does not constitute a waiver of any applicable privilege.

Reading, disclosure, discussion, dissemination, distribution or copying of this 
information by anyone other than the intended recipient or his or her employees or 
agents is strictly prohibited.  If you have received this communication in error, 
please immediately notify us and delete the original material from your computer.

Sempra Energy Trading Corp. (SET) is not the same company as SDG&E or SoCalGas, the 
utilities owned by SET's parent company.  SET is not regulated by the California 
Public Utilities Commission and you do not have to buy SET's products and services to 
continue to receive quality regulated service from the utilities.
**********************************************************************



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to