Error when reading BLOB field from Oracle usin Toplink

We experience a very annoying problem when trying to read a BLOB
field from Oracle 8.1.6.2.0 using TOPLink 3.6.3. I have attached the
exception stack trace that is reported to the console. As far as I can
judge a fault at oracle.sql.LobPlsqlUtil.plsql_length() happens first and
then at TOPLink.Private.DatabaseAccess.DatabasePlatform.convertObject().
The exception is permanently repeating that is very critical for us.
ServerSession(929808)--Connection(5625701)--SELECT LOBBODY, ID, LABEL, FK_OBJECT_ID, FK_OBJECTTYPE FROM NOTE WHERE (ID = 80020)
INTERNAL EXCEPTION STACK:
java.lang.NullPointerException
at oracle.sql.LobPlsqlUtil.plsql_length(LobPlsqlUtil.java:936)
at oracle.sql.LobPlsqlUtil.plsql_length(LobPlsqlUtil.java:102)
at oracle.jdbc.dbaccess.DBAccess.lobLength(DBAccess.java:709)
at oracle.sql.LobDBAccessImpl.length(LobDBAccessImpl.java:58)
at oracle.sql.BLOB.length(BLOB.java:71)
at TOPLink.Private.Helper.ConversionManager.convertObjectToByteArray(ConversionManager.java:309)
at TOPLink.Private.Helper.ConversionManager.convertObject(ConversionManager.java:166)
at TOPLink.Private.DatabaseAccess.DatabasePlatform.convertObject(DatabasePlatform.java:594)
at TOPLink.Public.Mappings.SerializedObjectMapping.getAttributeValue(SerializedObjectMapping.java:43)
at TOPLink.Public.Mappings.DirectToFieldMapping.valueFromRow(DirectToFieldMapping.java:490)
at TOPLink.Public.Mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:808)
at TOPLink.Private.Descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:173)
at TOPLink.Private.Descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:325)
at TOPLink.Private.Descriptors.ObjectBuilder.buildObjectsInto(ObjectBuilder.java:373)
at TOPLink.Public.QueryFramework.ReadAllQuery.execute(ReadAllQuery.java:366)
at TOPLink.Public.QueryFramework.DatabaseQuery.execute(DatabaseQuery.java:406)
I have started the application with Oracle JDBC logging on and found that the problem may originate in a possible lack of syncronization in the pooled connection implementation:
DRVR FUNC OracleConnection.isClosed() returned false
DRVR OPER OracleConnection.close()
DRVR FUNC OracleConnection.prepareCall(sql)
DRVR DBG1 SQL: "begin ? := dbms_lob.getLength (?); end;"
DRVR FUNC DBError.throwSqlException(errNum=73, obj=null)
DRVR FUNC DBError.findMessage(errNum=73, obj=null)
DRVR FUNC DBError.throwSqlException(reason="Logical handle no longer valid",
SQLState=null, vendorCode=17073)
DRVR OPER OracleConnection.close()
so the prepareCall() is issued against an already closed connection and the
call fails.
I assume we have been using a JDBC 2.0 compliant driver. We tried out
drivers that Oracle supplies for 8.1.6, 8.1.7 versions. To be true I
couldn't find any information about the JDBC specification they conform to. Does it
mean that these drivers may not be 100%-compatible with JDBC 2.0 Spec?
How can I find out if they are 2.0 compliant?
Also I have downloaded Oracle 9.2.0.1 JDBC drivers. This seemed to work
fine until we found another incompatibility which made us return back to
8.1.7 driver:
UnitOfWork(7818028)--Connection(4434104)--INSERT INTO STATUSHISTORY (CHANGEDATE, FK_SET_STATUS_ID) VALUES ({ts '2002-10-17 16:46:54.529'}, 2)
INTERNAL EXCEPTION STACK:
java.sql.SQLException: ORA-00904: invalid column name
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.jav
a:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java
:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatemen
t.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepare
dStatement.java:589)
at TOPLink.Private.DatabaseAccess.DatabaseAccessor.executeDirectNoSelect(
DatabaseAccessor.java:906)
at TOPLink.Private.DatabaseAccess.DatabaseAccessor.executeNoSelect(Databa
seAccessor.java:960)
at TOPLink.Private.DatabaseAccess.DatabaseAccessor.executeCall(DatabaseAc
cessor.java:819)
at TOPLink.Public.PublicInterface.UnitOfWork.executeCall(UnitOfWork.java:

Hello Yury,
I believe the problem is that TopLink's ServerSession by default executes read queries concurrently on the same connection. It does this to reduce the number of required connections for the read connection pool. Normally this is a good concurrency optimization, however some JDBC drivers have issues when this is done. I had thought that with Oracle JDBC 8.1.7 this issue no longer occurred, but perhaps it is only after version 9. I believe that the errors were only with the thin JDBC driver, not the OCI, so using the OCI driver should also resolve the problem. Using RAW instead of BLOB would also work.
You can configure TopLink to resolve this problem through using exclusive read connection pooling.
Example:
serverSession.useExclusiveReadConnectionPool(int minNumerOfConnections, int maxNumerOfConnections);
This will ensure that TopLink does not to try to concurrently execute read queries on the same connection.
I'm not exactly sure what your second problem with the 9.x JDBC drivers is. From the SQL and stack trace it would seem that the driver does not like the JDBC timestamp syntax. You can have TopLink print timestamp in Oracle's native SQL format to resolve this problem.
Example:
serverSessoin.getLogin().useNativeSQL();
Make sure you configure your server session before you login, or if using the TopLink Session Manager perform the customizations through a SessionEventListener-preLogin event.

Similar Messages

  • Problem with Pro*C reading BLOB field from Oracle 10g

    Hello Experts,
    We have a Pro*c application which is reading the BLOB data fields (a PNG image file) from Oracle data base. It holds the BLOB fields returned from the SQL query into a Unsigned Char structure in Pro*C. The program used work fine on AIX 32 – bit 4.3 and Oracle 8.1 environment.
    Recently, we have upgraded the environment to AIX 64-bit 5.3 and Oracle 10g.Since after the Pro*c program has problem in reading the Blob filed.
    Below is the query we are trying to execute –
    EXEC SQL
    SELECT
    signtre_image, image_file_name_ext
    INTO
    :msipLocalImage INDICATOR :msipLocalImage_i,
    :file_name_ext INDICATOR :file_name_ext_i
    FROM
    dcs_sign
    WHERE
    signtre_nbr = :signtre_nbr;
    Here signtre_image is the BLOB fields and msipLocalImage is a Pro*C structure define as below –
    typedef struct tagSignImage
    long len; /* Image length */
    unsigned char img[1]; /* Pointer to first byte. */
    } MOTS_SIGN_IMAGE;
    The quesry does not give any error or exception message in the Pro*C , program just stops at the point of executing the quesry..When we run the query commenting the BLOB filed it works fine. Also, the query runs good when we run it in the Oracle editor.
    There seems to be problem with the way we are reading the BLOB field in the new Oracle 10g enviromet.
    Does any body have any idea what’s wrong with this query? We really need it to work.
    Any Help will be greatly appreciated.
    Thanks,
    - Rajan Yadav

    Thanks a ton for your response.
    We made the necessary changes as suggested by you.This time we got another flavour of error - SQL Error Code - Inconsistent error while reading BLOB.
    Another thing we noticed is that the data field which we are trying to read is defined as LONG RAW instead of a BLOB in data base.
    Are these two things related in any sense or is there anything else which is causing the error.
    Once again Thanks for your help.
    - Rajan Yadav

  • Getting error when reading xml file from a remote connection

    Hi all,
    I want to read an xml file from a remote connection, not from my local machine.So when i am creating the data server i am giving the host name(that is the ip of the machine where the xml file is located), giving the proper username and password and giving the path of the xml file. When i am testing the connection the error that is coming:- "Connection failed and the xml file could not be created, verify that you have write permission in the directory"...
    but read write and execute permissions have been given on the directory as well as to the file...
    Regards,
    Sourav

    Hi Sutirtha,
    Initially I have started the agent.sh giving the agent name <agent name>and port number 20910 and defined it in the topology manager it is showing that the agent test is succesful. Then I tested a particular Data server against that agent and the test was successful.
    After this we had stopped the agent and restarted it.
    However now suddenly the testing against the remote agent is failing with the following excep:
    java.lang.Exception:
         at com.sunopsis.graphical.l.pm.a(pm.java)
         at com.sunopsis.graphical.l.pm.s(pm.java)
         at com.sunopsis.graphical.l.pm.g(pm.java)
         at com.sunopsis.graphical.l.pm.a(pm.java)
         at com.sunopsis.graphical.l.pm.a(pm.java)
         at com.sunopsis.graphical.l.iz.actionPerformed(iz.java)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.Dialog$1.run(Unknown Source)
         at java.awt.Dialog.show(Unknown Source)
         at java.awt.Component.show(Unknown Source)
         at java.awt.Component.setVisible(Unknown Source)
         at com.sunopsis.graphical.l.pm.q(pm.java)
         at com.sunopsis.graphical.l.pm.<init>(pm.java)
         at com.sunopsis.graphical.frame.b.jh.bx(jh.java)
         at com.sunopsis.graphical.frame.bo.w(bo.java)
         at com.sunopsis.graphical.frame.bo.d(bo.java)
         at com.sunopsis.graphical.frame.w.actionPerformed(w.java)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    PS: do i have to modify any file after or before starting the odi agent
    Thnks and Rgds,
    Sourav
    Edited by: user13263578 on Mar 15, 2011 9:35 PM
    Edited by: user13263578 on Mar 15, 2011 9:48 PM

  • BI Publisher throwing error when creating data model from Oracle BI Answers

    I'm having issues creating BI Publisher Datamodel using BI EE as a source. When i select the answer and put the inforamtion needed and hit OK ....it's start doing soehting and then it get there ....
    In the logs:
    It is weird that the Logs is having a message saying that path was not found "/users/mpoler/Data Model without Title.xmd"/_datamodel.xmd
    Any clue on what is going on?
    Thanks!
    Matias

    Can you try using a different account to run this report, if possible use someone from a different Application role.
    The last Time I saw something similar was when the integration between BIP and Analysis was done incorrectly and a few roles were missed.
    Letus know what you find out..

  • Lightroom encountered and error when reading from it preview cache and needs to quit

    A power outage caused my Lightroom 5.2 to shut down without closing.  When I powered back up and opened lightroom it gives me an error "Lightroom encountered and error when reading from it preview cache and needs to quit" and then it says it will try to fix it the next time it opens. I have opened it 20 times and it is not fixing it. I removed the program completely and upgraded to 5.5 AND it is still giving me the same error.  Is my catalog corrupt or something? I had it set to automatically load the most currently used catalog, so it is not allowing me to open or start a new catalog either. HELP!!!

    Search the forum, this has been answered many times.

  • I'm unable to open up Lightroom 5, I get this message in a pop up box: "Lightroom encountered an error when reading from it's preview cache and needs to quit" Underneath  that is "Lightroom will attempt to fix this problem the next time when it launches."

    I'm unable to open up Lightroom 5, I get this message in a pop up box: "Lightroom encountered an error when reading from it's preview cache and needs to quit" Underneath  that is "Lightroom will attempt to fix this problem the next time when it launches."  It hasn't, what should I do? Thanks Shawn (Irish Se7en) .

    Can you try to rename (not delete!) the folder named "YOUR_CATALOG_NAME Previews.lrdata" and restart Lightroom?

  • "Lightroom encountered and error when reading from its preview cache and needs to quit"

    I keep receiving this error every time I open LR, "Lightroom encountered and error when reading from its preview cache and needs to quit" and the app won't open. It said LR would try and fix this error next time I opened it but the error remains. I tried uninstalled and installing the app and the error remains.
    Any Ideas here? Is there another app that may be telling it where to look for the cache and it no longer there? I was using a ramdisk for a bit but ditched it. Not sure if that has something to do with it but it seems suspect.
    Your thoughts?
    --Kenny Brandon Wilson

    Talked to Adobe support this morning, this is their response in case anyone else is looking for help. I'm running a Windows 7 box, LR 5.6.
      Gokul: Click on start and type %appdata%, then open roaming folder.
      Edward: ok
      Gokul: Open Adobe folder.
      Gokul: Open Lightroom folder.
      Gokul: Open Lightroom folder> Preferences.
      Edward: ok
      Gokul: Rename Lightroom 5 Preferences.agprefs file as Lightroom 5 Preferences.agprefsOLD.
      Edward: OK
      Gokul: Please check if you can launch Lightroom without any error.
      Edward: it shows me a welcome screen and is asking me to select my country
      Edward: aka, register the software
      Gokul: You can skip and launch it.
      Edward: LR catalog not found
      Gokul: Please select the catalog.
      Edward: my original catalog?
      Gokul: Yes.
      Edward: testing integrity of catalog
      Edward: loaded just fine
      Gokul: Okay.
      Gokul: Please check if you can re-launch it again.
      Edward: yes, it worked!
      Gokul: Excellent!
      Gokul: Since your preferences were corrupted you were facing issue so we renamed the preferences file to reset it.
      Edward: aha....ok
    All of my import/export presets were intact along with develop user presets. I'm happy as a clam for my $10/month!

  • LR encountered an error when reading from its preview cache and needs to quit.

    I have the 30 day trial version of Lightroom.  I was able to use it for one week, but the past 1.5-2 weeks, it has been locked up and giving this error message.  How do I resolve the problem?  And how do I reset the 30 day free trial?  I would like to have time using the product, before deciding on the annual contract.
    "LR encountered an error when reading from its preview cache and needs to quit.  Lightroom will attempt to fix this problem the next time it launches."
    Thank you.

    Delete the preview cache from the Lightroom folder in your Pictures folder if you used the default placement. It has the extension .lrdata.
    You cannot reset the trial period.

  • I keep receiving this error every time I open LR, "Lightroom encountered and error when reading from its preview cache and needs to quit" and the app won't open. It said LR would try and fix this error next time I opened it but the error remains. I tried

    I keep receiving this error every time I open LR, "Lightroom encountered and error when reading from its preview cache and needs to quit" and the app won't open. It said LR would try and fix this error next time I opened it but the error remains. I tried uninstalled and installing the app and the error remains. I have windows 8. Can anyone please help???

    Use Windows Explorer to open the folder containing your catalog. The normal location is Pictures\Lightroom. Locate a folder with the extension .lrdata and delete that folder. Then you should be able to start Lightroom again, and Lightroom will begin building and new previews folder. Do not delete anything else.

  • It says Lightroom encountered an error when reading from a previous cache and needs to quit. Light room will attempt to to fix the problem the next time it launches.

    how do i fix this. It says Lightroom encountered an error when reading from a previous cache and needs to quit. Light room will attempt to to fix the problem the next time it launches.

    Have a look at this thread.
    Lightroom encountered an error when reading from its preview cache and needs to quit.  Lightroom will attempt to fix this problem the next time it launches"."

  • Error Launching LR 5: "Lightroom encountered an error when reading from its preview cache and..."

    Error Launching LR 5: "Lightroom encountered an error when reading from its preview cache and needs to quit.  Lightroom will attempt to fix this problem the next time it launches."
    I've tried renaming my catalog.lrcat file.  I've copied over my most recent backup of the catalog.lrcat and that didn't work either.

    On Mac:
    PS - to open the previews "folder" (a "package" is just a "special" folder) on Mac, ctrl-click and choose "Show package contents.." - same way you open any other special folder, like .app or .lrplugin..
    Rob

  • Upgraded to 5.4 when opening lightroom get a message "encountered an error when reading from its preview cache and need to quite" tried this several time but get the same eror message

    Upgraded to 5.4 when opening lightroom get a message "encountered an error when reading from its preview cache and need to quite" tried this several time but get the same error message.  Says Lightroom will attempt to fix the problem the next time it launches but that is not happening.  How do it fix this?

    Delete the preview cache using your operating system. It is a folder whose name ends with Previews.LRDATA. Do not delete the Lightroom catalog, which ends with .LRCAT

  • Lightroom 5 is not opening it gives me an error message there is an error when reading from its preview cache and needs to quite

    lightroom 5 is not opening it gives me an error message there is an error when reading from its preview cache and needs to quite
    it also says it will attempt to to fix the next time it opens it doesn't do anything

    Check this thread. Your Previews Cache files are corrupted.
    Re: preview cache?

  • Lightroom encountered an error when reading from its preview cache and needs to quit.  Says Lightromm will attempt to fix the problem the next time it launches, but on every re-launch I get the same message.  Any clue as to how to fix this problem?

    I recently updated my HP laptop's OS from WIndows8 to WIndows8.1.  When I went attempted to open Lightroom5 I got the following message:
    "Lightroom encountered an error when reading from its preview cache and needs to quit. "
    "Lightroom will attempt to fix the problem the next time it launches"
    Every time I relaunch I  get the same message.  I'd like to understand what might be causing the problem so I can remedy and get back to my photo editing. Any clue as to how to fix this problem would be greatly appreciated.
    JPM

    reset your preferences, Resetting (or 'Trashing') the Lightroom Preferences file - Lightroom Forums

  • "Lightroom encountered an error when reading from its preview cache and needs to quit. How do I fix this

    Recently updated to Windows8.1 got the message:  "Lightroom encountered an error when reading from its preview cache and needs to quit.  Lightroom will attempt to fix the error the next time it launches"  Get the same message on multiple launches.  Anyone know how to fix this?

    Re: "Lightroom encountered and error when reading from its preview cache and needs to quit"

Maybe you are looking for

  • Batch is being Generate two Record for Same Vendor in Payable

    Gusy, (Oracle Payable) We have entered six validate invoice with same site,vendor,Payment mod and currency as well but when we see batch in payment window ,it is being show two record insted of one transaction ,howerver system should show one record.

  • Sony RX 100 camera

    Does Lightroom 4 support RAW files from the Sony RX 100 camera? ( Important as my wife is considering buying me one of these cameras for my birthday! )

  • Ack for Inbound messages

    Hello All, I already worked with acknowledgements of outbound messages(and processing them in orchestration in case of failure etc). But now I have a requirement to generate acknowledgements for inbound messages, like I need to generate a custom outb

  • Offline approval for shopping cart PO and contract

    Hi , we have the requirement to have the offline approval for all the procurement documents. please can you guide me the procedure to set up the offline approval. i know the report /sapsrm/offlineapprovasend has to be executed , but what i want to kn

  • Working with subquery

    I am working with a subquery and am fairly new with the use of subqueries. So, any help would be much appreciated. When the query below is run. I get an eror message: ORA-00933: SQL command not properly ended When I run the two queries separately, th