PreparedStatement.setTimestamp does not allo use of DATE index..

(...although they' re not suposed be related)
Hi;
I use Oracle 10g with Java JDBC driver ojdbc14.jar and I have a PreparedStatement on which among other "bind" JDBC parameters I have a java.util.Date. The ORM that we use (Hibernate 2.0.3) passes this Date instance as a java.sql.Timestamp binding it with setTimestamp on the PreparedStatement.
Interestingly enaugh, this way of binding the value does not make the database use the date column index, although the explain available from TOAD / Session browse, for instance, tells me the planner first demands an index scan there (it is possible i think that explain only operates on prepared SQL alone, disregarding value initial types and values). Doing a preparedStatement.setDate(value) instead, passing a java.sql.Date, uses the index and probably fully respects the Explain Plan that I have seen.
I assure you I have done many tests, with exact same query, parameter types and values, session origination and environment and changing one thing at a time. The only thing that being changed enables the query to make use of the DATE column index and return under a second, compared to tens of seconds of full table scan with expensive function calls, is to replace the preparedStatement.setTimestamp with setDate.
This can only be a JDBC bug, as far as I can tell. Do you know of this problem? What may be the cause?
As a note, since I need to continue to use that version of Hibernate on that spot, I momentarily worked around this apparent bug by modifying the SQL WHERE clause in order to provide the DATE value as to_date function output from a String bind, so doing date_col = to_date('YYYY-MM-DD', :value) instead of date_col = :value. Works fain, but just a work around.
Looking forward for your answer and suggestions,
Nicu Marasoiu

A few remarks:
- Toad explain plans can be frought by implicit data type conversions.
Generally speaking everything is treated as a varchar2.
- You would need to show the plan from v$sql_plan.
- It would be a JDBC bug if you can show 'correct' behavior from sql*plus, making sure you actually do use bind variables of the correct type (so VARIABLE foo date prior to running the SQL, the SELECT referencing :foo)
- In the past I have observed strange CBO behavior because the date wasn't a complete date (ie time was missing). This can be rectified by function based indexes.
- You probably can enable event 10053 in your JDBC session, or event 10046 level 12
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • JDODataStoreException: The instance null does not exist in the data store

    I'm unable to figure out how this exception occurs.
    I have a class IDCounter which has a number of fields such as
    'm_Name' (String)
    'm_AccountName' (String)
    'm_UserName' (String)
    'm_Description' (String)
    'm_CreationDate' (Date)
    'm_LastModifiedDate' (Date)
    'm_DeletedDate' (Date)
    'm_Count' (long)
    The filter I'm using is "m_AccountName == \"test\" && m_UserName
    ==\"test\" && m_DeletedDate == null"
    The generated SQL statement is "SELECT t0.M_IDX, t0.JDOCLASSX,
    t0.JDOLOCKX, t0.M_ACCOUNTNAMEX, t0.M_CREATIONDATEX, t0.M_DELETEDDATEX,
    t0.M_DESCRIPTIONX, t0.M_LASTMODIFIEDDATEX, t0.M_NAMEX, t0.M_USERNAMEX,
    t0.M_COUNTX FROM ABSTRACTENTITYX t0 WHERE ((t0.M_DELETEDDATEX IS NULL) AND
    t0.JDOCLASSX = 'com.ewarna.pdm.entities.IDCounter')"
    Exception Trace:
    javax.jdo.JDODataStoreException: The instance null does not exist in the
    data store.
         at
    com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.instantiateRow(LazyResultList.java:165)
         at
    com.solarmetric.kodo.impl.jdbc.runtime.LazyResultList.get(LazyResultList.java:96)
         at java.util.AbstractList$Itr.next(AbstractList.java:416)
         at
    com.solarmetric.kodo.runtime.ResultListIterator.next(ResultListIterator.java:49)
         at
    com.solarmetric.kodo.impl.jdbc.runtime.ResultListFactory.createResultList(ResultListFactory.java:85)
         at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCStoreManager.java:646)
         at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java:150)
         at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:580)
         at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:428)
         at
    com.solarmetric.kodo.query.QueryImpl$SynchronizedQuery.execute(QueryImpl.java:1331)
         at
    com.ewarna.pdm.sessions.persistence.BasicQuery.getByAdvancedFormula(BasicQuery.java:78)
         at
    com.ewarna.pdm.sessions.persistence.BasicQuery.getByFormula(BasicQuery.java:119)
         at
    com.ewarna.pdm.sessions.persistence.BasicQuery.getByFormula(BasicQuery.java:95)
         at
    com.ewarna.pdm.sessions.persistence.BasicQuery.getAll(BasicQuery.java:131)
         at
    com.ewarna.pdm.sessions.persistence.GenericEntityManager$7.execute(GenericEntityManager.java:305)
         at
    com.ewarna.pdm.sessions.persistence.GenericEntityManager.execute(GenericEntityManager.java:251)
         ... 18 more

    Youcan no longer display a workbook. You receive an error message when opening: <Internal error>: 1201 document storage
    Cause and prerequisites
    In very rare cases, when you store a workbook, you might not be able to open it again.
    Solution
    Function module BDS_PHIOS_GET_RIGHT has to be changed so that the last available version of the Workbooks can be displayed.

  • Payroll period does not correspond to master data error in INLK run & soln

    Dear All,
    Just wanted to share this Issue and solution which i found after debugging.
    I am not sure it is 100% correct.
    I am working on indian payroll and was doing lagacy data transfer with INLK schema
    i was used to get error '2 payroll period does not correspond to master data'
    and this was for only new joinees in that period .what i found out after debugging is
    for e.g. employee is hired in 03.06.2011 .and record in t558b is
    90300035 1  2011    1 2011 3 01.06.2011 31.06.2011
    where 01.06.2011 is a for period begin date ,
    now in payroll program this is being checked with joining date in following subroutine check_aper_versus_t558b
    so it ends up with above error.now if i go and change 01.06.2011 to 03.06.2011 in T558B then payroll will be successful.
    I dont no whether this is right approach but this removed that error.Just wanted to share so
    It might help the members.

    la diferencia es la fecha del campo FPBEG que debe ser la fecha para los empleados que no esten con el año o periodo completo
    the difference is the date field FPBEG Table T558B to be the date for employees who are not full with the year or period

  • In FB60, duplicate invoice check does not work if invoice date is different

    In FB60, duplicate invoice check does not work if invoice date is different
    This issue is in FB60 and not MIRO.
    Duplicate invoice check is activated in vendor master.
    I posted an invoice for a vendor with amount $ 100, Reference 1234 Invoice date Nov 01, 2011
    I tried posting for same vendor (and also Co Code) with amount $ 100, Reference 1234 Invoice date Nov 01, 2011. System does not allow. This is fine.
    Now I change only date, from Nov 01 to Nov 02, and system allow posting.
    Why I don't get the error message when date is different ? It should not be treated as a different invoice since invoice reference, amount, Vendor and Co Codes are same.
    SAP documentation says that it checks document date during duplicate invoice check even for FI invoices, then why does it allows in this case.
    Is this a bug ?
    I already tried changing settings in SPRO under LIV, this does not impact FB60 invoice booking.
    Thanks
    Sandeep

    Hi,
    Use BTE - 1110 - (Check on Invoice Duplication) for FB60. Take the help of your ABAPer to make a coding in Function module mentioned in BTE.
    Need to make a copy of the FM and then you can do relevant coding.
    refer the link.
    [http://www.thesapconsultant.com/2006/10/sap-business-transaction-events.html]
    Regards,
    Shridhar

  • LOV does not show newly added data in the same session

    Hi guys,
    I work with JDeveloper 11g Release 2. We use Oracle ADF to develop our web app.
    In a page we have a LOV (say the page name is "a"). The related data for that LOV is inserted to the db in another page ( say the page name is "b").
    When new data is added in the page "b" and goes directly to the page "a" the LOV does not show newly added data. But if the user log out and log in again
    LOV shows newly added data correctly.
    Is there a way to show the newly added data in the same session without logging out? Please help.
    Regards !
    Sameera.

    Add the following method in your ViewRowImpl base class:
    public void refreshLOVAccessorQueries() {
        List lovs = getViewDef().getListBindingDefs();
         if (lovs != null) {
             for (Object obj : lovs) {
                getListBindingRSI((ListBindingDef)obj).getRowSet().executeQuery();
                 ListBindingDef lbd = (ListBindingDef)obj;
    Export that method to the Row Client interface, add him to the pageDef, and invoke in the executables section of the pageDef:
        <executables>
    <invokeAction Binds="refreshLOVAccessorQueries" id="callRefreshLOVs"
    RefreshCondition="#{!requestContext.postback and empty bindings.exceptionList}"/>
       </executables>

  • Chart size does not extend with the data

    Hi,
    One of my reports has a horizontal bar and the chart size does not grow with the data. The chart displays fine if I have minimal amount of data. If the data grows, the display is bizarre, it's just messed up. Is there an option I need to set? Please provide your inputs.
    Thanks
    Arch

    Hi,
    I tried with all these options, but no success. I remember I used to get full visible charts initially. Not sure what has happened charts are getting chopped off by at least 50px right and bottom. Interestingly When I export the chart to Excel it looks perfect.
    Any suggestion. Has anyone faced this issues. I am using 11.1.1.5 version.

  • DB Connector Error : the license key does not include use of OpenSQL driver

    Hello,
    I am new developer on Crystal Report tool and i face an issue : When I try to refresh data I get the following error message :
    DB Connector Error : the license key does not include use of OpenSQL driver.
    Does someone know how to get the correct license key ?
    Many thanks for your help!
    Regards,
    Christiane

    Hi Christiane,
    What version of Crystal Reports are you using?
    Who owns the OpenSQL driver?
    Thank you
    Don

  • Rejected...We found that your app does not follow the iOS Data Storage Guidelines,

    Where and how do I fix this?
    We found that your app does not follow the iOS Data Storage Guidelines, which is required per the App Store Review Guidelines.
    In particular, we found that on launch and/or content download, your app stores 3.54MB. To check how much data your app is storing:
    - Install and launch your app
    - Go to Settings > iCloud > Storage & Backup > Manage Storage
    - If necessary, tap "Show all apps"
    - Check your app's storage
    The iOS Data Storage Guidelines indicate that only content that the user creates using your app, e.g., documents, new files, edits, etc., should be backed up by iCloud.
    Temporary files used by your app should only be stored in the /tmp directory; please remember to delete the files stored in this location when the user exits the app.
    Data that can be recreated but must persist for proper functioning of your app - or because customers expect it to be available for offline use - should be marked with the "do not back up" attribute. For NSURL objects, add the NSURLIsExcludedFromBackupKey attribute to prevent the corresponding file from being backed up. For CFURLRef objects, use the corresponding kCFURLIsExcludedFromBackupKey attribute.

    You're submitting a Newsstand app, right? This error is still under investigation, but the current workaround is create SD (1024x768/768x1024) cover images for your HD (2048x1536) folio renditions and try again.
    More info here:
    http://forums.adobe.com/message/4730637#4730637

  • If you start downloading a song on your iphone and it says downloading error tap to retry and you don't tap it does it still use your data?

    i started to download a song on my iphone and it said 'downloading error tap to retry'. i never tapped it but i was just wondering does it still use my data?

    but nothing is downloading because i never pressed tap to retry so does that still use data?

  • Media Encoder CS6 does not always "Use Previews"

    I've attempted several transcodes using pre-rendered timelines in Premiere Pro. Media encoder does not always use the preview files despite the appropriate box being checked. Any suggestions what I can look for? I don't see that I am doing anything different between the times it works and the times it doesn't.
    Bruce B.

    We are all just incompetent users here.  As pointed out before this is just a user to user forum, Adobe rarely checks in.
    I was hoping by now you would have gotten to the bottom of this problem and were offering a solution.

  • Lightroom does NOT make use of new/fast hardwares!

    For those who are considering a new computer here's my experience....
    Lightroom 4 does NOT make full use of new/fast CPUs / SSDs!
    I’ve been frustrated with Lightroom speed since launch and held on to my “old” Xeon work station for two years…. I recently invested in the latest Intel CPU and IO technology and I'm very disappointed how Lightroom 4 does not make use of it. It's most noticeably sluggish from one photo to the next during editing. This may seem small but when I edits hundreds of images everyday it really slow me down.
    See my system specs at very bottom of this post. I don't think there's a bottle neck in performance! I love my new setup and it's a pleasure to use the OS. BUT I'm so disapointed everytime I load up Lightroom. (My typical Lightroom edits are 600-900 sRAW images - I edit down my photos in Photo Mechanic 5! It's just too slow in Lightroom)
    Lightroom still take time to load each image when advance from one image to the next (During editing). Isn’t smart enough to cache 100 images in advance let say. (1:1 previews as been created!)
    Won’t make use of more than 8GB ram. No matter how big the RAW working set is.
    Very slow switching from one working module to another
    Lightroom Jpeg export won’t make use of more than 25% of new Intel Xeon E5 series dual processors processing power 12 cores. 6-9 cores are literally taking a nap during export!
    I’ve tried everything found in Adobe suggestion link below:
    http://helpx.adobe.com/lightroom/kb/optimize-performance-lightroom.html
    * I definately tried 1:1 render preview and all of the other jazz found in link directly above!
    * Running all latest firmwares and updates
    I hope the next version of Lightroom will actually make use of good hardware instead of adding on more features. We desperately need a snappy/responsive Lightroom for sake of productivity! I'm not here to put down Adobe. I'm a big fan of Adobe and Intel and have been using them for 15 years.
    My Setup:
    Dell Workstation T7600
    Dual Xeon E5-2630 2.5GHz (12 Cores Total)
    64GB 1600Mhz RAM
    OCZ RevoDrive 3X2 - 1500MB/s (Boot / Camera Raw Cache)
    4 Intel 520 Series SSD in RAID0 with dedicated 1GB Cache SAS/SATA PCIe 3.0 controller (Working RAW files)
    Nvidia GTX680 - 4GB VRAM (I know this made for 3D but it has PCIe 3.0 connectivity - Quadro 4000 PCIe 2.0 wasn't any better)
    Drobo-S 2GBx5 (Strictly Storage)
    Windows 7 Ultimate (Bare minimum! Just Adobe CS6 suite and Microsoft Office 2010)

    Can you copy this to the Feature Request forum so we can vote on it please?  http://feedback.photoshop.com/photoshop_family  And then post the link here so we can find it.  It'll get my vote.
    There are a couple of others you might like to vote on too, such as using the embedded preview for editing down.  http://feedback.photoshop.com/photoshop_family/topics/lightroom_capability_to_display_embe dded_preview
    In terms of workarounds for now, if you haven't tried the 4.2RC yet, you might find the module switching a bit faster.  And for better use of your exports processing power, try splitting your export into 3 or 4 and running them concurrently (i.e. set the first going, and immediately set the second going, etc.) as that'll make better use of the extra cores if your hard drives are able to keep up with them.

  • Lightroom 5.4 does not open, using windows 7

    lightroom 5.4 does not open, using windows 7. I downloaded the trail and it does not open. I want to buy it, but i am afraid it will not work. I do not get an error code or anything it just will not open.

    Thanks but none of the options in that KB fix the problem.
    The "Exit Code" was 3 rather than "0" and so it doesn't look like the patch will install.  In terms of the third option, I mentioned in my original message that I cannot "Deactivate" my other CS6 programs because that option is grayed out in those programs.  But those programs work just fine (other than Acrobat Pro X) and so I think there may be a bigger problem with all of my Adobe products.

  • HT4157 I have an iPad 2 and it does not display the cellular data button under settings

    I have an iPad 2 and it does not display the cellular data button under settings.  It does display a Bluetooth button in its place. I have tried the reset but no luck

    Is the iPad the Cellular version? Does it have an active Data plan? Does it have a Sim card installed in inside it?

  • The iPad Mini does not charge using a laptop

    My brand new iPad Mini does not charge using my macbook pro, but it does when is connected to de ac power wall adapter !!!

    That is the way is is supposed to work. Your MBP does not supply enough power to charge the battery efficiently. It may be charging, but at a trickle rate and it will show as not charging. That is why a power adapter is included with the iPad. Use it.
    Read more about charging the battery here.
    http://support.apple.com/kb/HT4060

  • Illegal dependency access list does not allow use of caf/eu/gp/api

    I am using NWDS 2004s and working with GP implementation.
    I am also able to see the development components as caf/eu/gp/api and sap.com/caf/gp/api/wd after copying the required files.
    But while selecting caf/eu/gp/api i am getting following exception
    Illegal dependency access list does not allow use of caf/eu/gp/api
    Please suggest if you have any idea regarding this.
    Regards
    Satya

    Hi Satyabrata,
    Are you using NWDI for development, or local development?
    I had the same problem when using local development components. I read somewhere in the documentation that for this you have to use the NWDI.
    Now I am using NWDI and this is working correctly.
    Johan

Maybe you are looking for

  • Prime Instant Video error 6205

    I got amazon instant video thinking it would be great to watch the films it offers. It worked for about 7 days, now the error 6205 just pops up and nothing will load. I have followed all of the microsoft troubleshooting steps on the website, yet it s

  • Name Field Cleared - Enter as Guest

    Hi When guests are entering my rooms, they click on the radio button "Enter as Guest", type their name into the text box and click "Enter Room".  Their name field is then cleared out to blank. No matter what content is entered, it gets erased and use

  • How to mark ALBPM messages as non-persistent?

    Hi, When using the WLS JMS Server, persistence for the messages sent through the queue is not required since ALBPM uses the JMS Queue as a dispatching mechanism only. However, since the messages sent to the Queue are marked as "Persistent", you must

  • Security Updates Included in Mavericks 10.9.5

    I recently installed OS X Mavericks 10.9.5.  Does this include the security update for Bash 1.0 and the built in XProtect malware definitions for the Mac.BackDoor.iWorm malware?

  • Dvd burned onto rev drive??????  HELP!

    I clicked on burn in dvd studio pro and it formatted the dvd to my rev drive that was attached via firewire. Now I can't erase the files off my rev and it is useless. Has this ever happened to anyone and how do I make my rev drive a normal hard drive