DOM validation using Java is extremely slow

I have a large XML file ~8MB. When I do validation on it using java api, takes ~5 hours to process it.
I have narrowed down the problem to xs:unique rules in the schema file. When I remove these rules, validation takes ~1 min.
I have tried using MSXML parser with unique rules and it take about 30 min.
My question is how could I speed up the validation in Java with these unique rules in the schema.
Any help will be greatly appreciated.
Thanks.

Basically, you are saying removing the unique elements
from schema and do the checking myself. This means
everytime the schema is updated with new unique rules,
I will have to modify the code to check for unique
elements.
Is there any other way to tackle this problem?You can choose what processing is done with the XML parser, and what is done within java, if you control the schema. Uniqueness is one that I have preferred to perform in java, since I often perform other validations in java anyway, and it works well. Just my opinion.
If you post some XML/XSD code and list the parser you are using, someone that uses xs:unique may find something they can help you with.
-Scott

Similar Messages

  • My java is extremely slow in yosemite

    my java is extremely slow in Yosemite. i found existing comments on uninstall java and reinstall. I did reinstalled java couple of times, but not helping.
    when i simply enter java, java -version, javac in the terminal, its taking **** lot of time to respond. so not able to run even single simple java program. but other softwares are working fine. i am having python and running python code is pretty fast.
    how to resolve this?

    Apple doesn’t routinely monitor the discussions. These are mostly user to user discussions.
    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback
    Or you can use your Apple ID to register with this site and go the Apple BugReporter. Supposedly you will get an answer if you submit feedback.
    Feedback via Apple Developer

  • XML Validation using java for SQL Injection and script validation

    I have an input coming from xml file.
    I have to read that input and validate the input against sql injections and scripts.
    I require help now how to read this xml data and validate against the above two options.
    I am a java developer.
    in this context what is marshelling?

    http://www.ibm.com/developerworks/library/x-javaxmlvalidapi.html?ca=dgr-lnxw07Java-XML-Val
    http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/package-summary.html
    The following code validates the xml against a xml schema
    // define the type of schema - we use W3C:
    String schemaLang = "http://www.w3.org/2001/XMLSchema";
    SchemaFactory factory = SchemaFactory.newInstance(schemaLang);
    Schema schema = factory.newSchema(new StreamSource("sample.xsd"));
    Validator validator = schema.newValidator();
    // at last perform validation:
    validator.validate(new StreamSource("sample.xml"));Message was edited by:
    haishai

  • Having trouble navigating away from a page with streaming video or using menu items-extremly slow to react

    I watch twit.tv daily. anytime I am on the twit page and try to open another tab or try to use a menu item it takes an extremly long time to react to mouse click. At least 15 to 30 seconds. This started happening several updates ago for version 3.6.

    So, since I got no reply to my question I took the iPod into the Apple store and tried to dock it to another third party device. Same problem, no digital control of the iPod. After about 30 minutes of looking it over, the Apple Genius agreed the issue was likely hardware related and issued me a replacement. So apart from about an hour of my time in the store and however long it will take me to reload my library, I'm rather pleased.

  • Schema Export using DBMS_DATAPUMP is extremely slow

    Hi,
    I created a procedure that duplicates a schema within a given database by first exporting the schema to a dump file using DBMS_DATAPUMP and then imports the same file (can't use network link because it fails most of the time).
    My problem is that a regular schema datapump export takes about 1.5 minutes whereas the export using dbms_datapump takes about 10 times longer - something in the range of 14 minutes.
    here is the code of the procedure that duplicates the schema:
    CREATE OR REPLACE PROCEDURE MOR_DBA.copy_schema3 (
                                              source_schema in varchar2,
                                              destination_schema in varchar2,
                                              include_data in number default 0,
                                              new_password in varchar2 default null,
                                              new_tablespace in varchar2 default null
                                            ) as
      h   number;
      js  varchar2(9); -- COMPLETED or STOPPED
      q   varchar2(1) := chr(39);
      v_old_tablespace varchar2(30);
      v_table_name varchar2(30);
    BEGIN
       /* open a new schema level export job */
       h := dbms_datapump.open ('EXPORT',  'SCHEMA');
       /* attach a file to the operation */
       DBMS_DATAPUMP.ADD_FILE (h, 'COPY_SCHEMA_EXP' ||copy_schema_unique_counter.NEXTVAL || '.DMP', 'LOCAL_DATAPUMP_DIR');
       /* restrict to the schema we want to copy */
       dbms_datapump.metadata_filter (h, 'SCHEMA_LIST',q||source_schema||q);
       /* apply the data filter if we don't want to copy the data */
       IF include_data = 0 THEN
          dbms_datapump.data_filter(h,'INCLUDE_ROWS',0);
       END IF;
       /* start the job */
       dbms_datapump.start_job(h);
       /* wait for the job to finish */
       dbms_datapump.wait_for_job(h, js);
       /* detach the job handle and free the resources */
       dbms_datapump.detach(h);
       /* open a new schema level import job */
       h := dbms_datapump.open ('IMPORT',  'SCHEMA');
       /* attach a file to the operation */
       DBMS_DATAPUMP.ADD_FILE (h, 'COPY_SCHEMA_EXP' ||copy_schema_unique_counter.CURRVAL || '.DMP', 'LOCAL_DATAPUMP_DIR');
       /* restrict to the schema we want to copy */
       dbms_datapump.metadata_filter (h, 'SCHEMA_LIST',q||source_schema||q);
       /* remap the importing schema name to the schema we want to create */     
       dbms_datapump.metadata_remap(h,'REMAP_SCHEMA',source_schema,destination_schema);
       /* remap the tablespace if needed */
       IF new_tablespace IS NOT NULL THEN
          select default_tablespace
          into v_old_tablespace
          from dba_users
          where username=source_schema;
          dbms_datapump.metadata_remap(h,'REMAP_TABLESPACE', v_old_tablespace, new_tablespace);
       END IF;
       /* apply the data filter if we don't want to copy the data */
       IF include_data = 0 THEN
          dbms_datapump.data_filter(h,'INCLUDE_ROWS',0);
       END IF;
       /* start the job */
       dbms_datapump.start_job(h);
       /* wait for the job to finish */
       dbms_datapump.wait_for_job(h, js);
       /* detach the job handle and free the resources */
       dbms_datapump.detach(h);
       /* change the password as the new user has the same password hash as the old user,
       which means the new user can't login! */
       execute immediate 'alter user '||destination_schema||' identified by '||NVL(new_password, destination_schema);
       /* finally, remove the dump file */
       utl_file.fremove('LOCAL_DATAPUMP_DIR','COPY_SCHEMA_EXP' ||copy_schema_unique_counter.CURRVAL|| '.DMP');
    /*EXCEPTION
       WHEN OTHERS THEN    --CLEAN UP IF SOMETHING GOES WRONG
          SELECT t.table_name
          INTO v_table_name
          FROM user_tables t, user_datapump_jobs j
          WHERE t.table_name=j.job_name
          AND j.state='NOT RUNNING';
          execute immediate 'DROP TABLE  ' || v_table_name || ' PURGE';
          RAISE;*/
    end copy_schema3;
    /The import part of the procedure takes about 2 minutes which is the same time a regular dp import takes on the same schema.
    If I disable the import completely it (the export) still takes about 14 minutes.
    Does anyone know why the export using dbms_datapump takes so long for exporting?
    thanks.

    Hi,
    I did a tkprof on the DM trace file and this is what I found:
    Trace file: D:\Oracle\diag\rdbms\instanceid\instanceid\trace\instanceid_dm00_8004.trc
    Sort options: prsela  execpu  fchela 
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    SQL ID: bjf05cwcj5s6p
    Plan Hash: 0
    BEGIN :1 := sys.kupc$que_int.receive(:2); END;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        3      0.00       0.00          0          0          0           0
    Execute    229      1.26     939.00         10       2445          0          66
    Fetch        0      0.00       0.00          0          0          0           0
    total      232      1.26     939.00         10       2445          0          66
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: SYS   (recursive depth: 2)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      wait for unread message on broadcast channel
                                                    949        1.01        936.39
    ********************************************************************************what does "wait for unread message on broadcast channel" mean and why did it take 939 seconds (more than 15 minutes) ?

  • Date of birth validation using java script-very urgent

    hi all,
    i am new to javascript. i need to validate the date of birth entered by the user.date entered should not be greater than today's date.help me out with the code.i need to display only error messages without using alert boxes.

    user Date() function in javascript...
    This link wld help you in getting some idea on date functions..
    http://www.w3schools.com/js/js_obj_date.asp
    regards
    Shanu

  • Xs:duration  string validation using java

    I want to validate the string whether it is valid xs:duration type or not ?
    The time interval is specified in the following form "PnYnMnDTnHnMnS"
    P indicates the period (required)
    nY indicates the number of years
    nM indicates the number of months
    nD indicates the number of days
    T indicates the start of a time section (required if you are going to specify hours, minutes, or seconds)
    nH indicates the number of hours
    nM indicates the number of minutes
    nS indicates the number of seconds
    The following is an example of a duration declaration in a schema:
    P5Y
    P5Y2M10D
    P5Y2M10DT15H
    PT15H
    -P10D(To specify a negative duration, enter a minus sign before the P)

    String.matches("-?P(?=\\d+|T)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d+)(\\d+H)?(\\d+M)?(\\d+S)?)?");will give :
    "P5Y" : true
    "P5Y2M10D" : true
    "P5Y2M10DT15H" : true
    "PT15H" : true
    "-P10D" : true
    "P2M10D5Y" : false
    "" : false
    "P" : false
    "T" : false
    "PT" : false
    "P5YT" : false
    "5Y" : false
    "ABC" : false
    Regards

  • I use MacBook Air. Firefox 4 is extremely slow with java apps, is it going to be fixed or should I give up this browser ?

    After installinf current version of Firefox I can hardly use it with web pages that heavily use java, like chats on www.polchat.pl. Previous version worked similar to Safari or IE. Newest is extremely slow. Is it goimg to be fixed ?

    After installinf current version of Firefox I can hardly use it with web pages that heavily use java, like chats on www.polchat.pl. Previous version worked similar to Safari or IE. Newest is extremely slow. Is it goimg to be fixed ?

  • Hello, I have a macbook pro late 2011 15 inch with 4 gb ram. My macbook runs extremely slow when logging in after waking up from sleep, locking up and I am unable to use the keyboard. Is there a fix?

    My macbook runs extremely slow when logging in after waking up from sleep, locking up and I am unable to use the keyboard. Furthermore, when just using safari to watch streaming television, my computer gets really slow, and locks up, and the dock appears blank and I sit here frustrated. Anytime i wake up my computer, my keys don't respond and I've waited at most 3 minutes untill i can type in my password. Even sometimes when i type in my password and hit enter, it takes forever to open up my mac. I have barely used any storage in my macbook, since i only use it for college, and I have run clamscan wiht no viruses showing... Any ideas?

    when just using safari to watch streaming television, my computer gets really slow, and locks up, and the dock appears blank
    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output andWi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • My final cut is running extremely slow after having for 6 months.  I use external hard drives and save nothing on my computer.  it takes a long time to render now. do you think something is wrong with computer. took it to mac store but they fail to help

    my final cut is running extremely slow after having for 6 months.  I use external hard drives and save nothing on my computer.  it takes a long time to render now. do you think something is wrong with computer. took it to mac store but they fail to help me.  I have a 13 inch mac book pro 10.6.8 8gb 2.3 gfz intel core i5

    What did Apple tell you about what they did (or did not) find here?
    See if working on the main disk is any faster.
    USB2 is glacial, as I/O interconnects go.  And USB2 disks have been known to fail, or sometimes to drop back to USB1 speeds, too.  FireWire 800 is substantially faster than USB2, but still not as fast as the internal drive connections can provide.
    Put another way, start varying your configuration, and see which configuration changes (still) have the problem, and which don't.

  • Macbook Pro extremely slow all of a sudden, impossible to use.

    Friday afternoon my Mac froze and after powering down and restarting, it has been extremely slow. Before now it was running perfectly.  Now, it takes about 20 minutes to start up and then about another 20 minutes to load the dock and another 20 minutes to open an app, etc. It's impossible to use. I get the loading wheel between every word I type. 
    After running in safe mode/repairing hard drive/etc. nothing had changed. So I just decided to backup all of my stuff and try to restore it to factory settings. I erased the hardrive and set up my computer again. It's still running the same way though. Extremely slow, impossible to use.
    I'm running on Mavericks 10.9.3. Is there anything I could do or could this be something like a failing hard drive?
    I bought my mac about 8 months ago. I already made an appointment at the genius bar for tomorrow night but I would really really rather not have to go. The store near me is just horrible, they make up excuses to why your warranty might be void and they are just plain rude, from my experience and from what I've heard from many others they don't really know what they're doing.

    tiffanyisweird,
    your AHT should have been reïnstalled with the factory reset. It could well be copying the AHT to your internal disk now over the Internet.
    Is that second closest store an Apple store, or an Apple-authorized service center? You might find that there’s an Apple-authorized service center closer than that second Apple store. (I’m about three hours away from my closest Apple store, but my closest Apple-authorized service center is less than two hours away.)

  • Parsing an XML using DOM parser in Java in Recursive fashion

    I need to parse an XML using DOM parser in Java. New tags can be added to the XML in future. Code should be written in such a way that even with new tags added there should not be any code change. I felt that parsing the XML recursively can solve this problem. Can any one please share sample Java code that parses XML recursively. Thanks in Advance.

    Actually, if you are planning to use DOM then you will be doing that task after you parse the data. But anyway, have you read any tutorials or books about how to process XML in Java? If not, my suggestion would be to start by doing that. You cannot learn that by fishing on forums. Try this one for example:
    http://www.cafeconleche.org/books/xmljava/chapters/index.html

  • Parsing xml using DOM parser in java

    hi there!!!
    i don have much idea about parsing xml.. i have an xml file which consists of details regarding indentation and spacing standards of C lang.. i need to read the file using DOM parser in java n store each of the attributes n elements in some data structure in java..
    need help as soon as possible!!!

    DOM is the easiest way to parse XML document, google for JDOM example it is very easy to implement.
    you need to know what is attribute, what is text content and what is Value in XML then easily you can parse your document with dom (watch for space[text#] in your XML document when you parse it).
    you get root node then nodelist of childs for root then go further inside, it is easy believe me.

  • How to do Front End Validation for JSP Forms using Java Script with 9iJD...

    How to do Front End validation using 9iJD. Any wizard is there. We need to do the val. using Java Script. If its not available, please include that in the Production Release.

    Thanks a lot. When is the Production Release is scheduled. Please tell us whether itll be available for Free Download. Bec, we couldnt buy. Bec, if its working fine with all the options without any bug only, we can ask our company to buy 9iJD by stating the advantages. Just explain us.

  • Mavericks is extremely slow. NetFlix used to stream just fine until I loaded the "upgrade." What is the problem with this OS?

    Mavericks is extremely slow. NetFlix used to stream just fine until I got the "upgrade." Everything is slower now, and I have plenty of RAM. Any insights?

    Hello Sunny James,
    I would be concerned too if my iMac was running slowly after upgrading to Mavericks.  I found a couple of articles I recommend to help isolate and troubleshoot this issue.
    I recommend reviewing this article first for possible causes of the slowness:
    OS X Mavericks: If your Mac runs slowly
    http://support.apple.com/kb/PH13895
    You can further isolate the issue by determining if it is only happening in your user account or if it is happening system-wide:
    Isolating an issue by using another user account
    http://support.apple.com/kb/TS4053
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

Maybe you are looking for

  • Node doesn't belong to the current document and Invalid UTF8 encoding errors

    Hi I'm creating a XSQL page that calls a PL/SQL procedure: <?xml version="1.0" encoding="ISO-8859-1"?> <page xmlns:xsql="urn:oracle-xsql" connection="sgvrt"> <xsql:include-owa>xml_indicadores_epm;</xsql:include-owa> </page> When I run the page I get:

  • Flash CS5 bug

    My new installation of Flash CS5 acts very buggy.  Keyboard shortcuts stop working, and I can pick fill colors but not text or line colors - just have a gray box with a few horizontal/vertical lines.  Is this a known bug?  Is there an easy fix?  Clos

  • Error #1009 Using SpellUIForTLF

    The error occurs when you activate the spelling APPLICATION <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"    xmlns:s="library://ns.adobe.com/flex/spark"    xmlns:mx="library://ns.adobe.com/flex/mx" min

  • Accept date at prompt

    hi i am trying the following accept date1 date for 'dd-mm-yyyy' prompt 'start date' start date 01-01-2009 accept date2 date for 'dd-mm-yyyy' prompt 'end date' end date 31-01-2009 def date1 define date1 ="01-01-2009" (CHAR) def date2 define date2 ="31

  • Maximum number of columns in a cursor

    Hi, I have declared a cursor joining multiple tables. Is there a limit on the number of columns I can select in the cursor? If so, what is the max number allowed? Version is Oracle9i Enterprise Edition Release 9.2.0.1.0 Thanks SP