Menu

#193 dbunit inserts JUNK for NCLOB column

(future)
pending
NCLOB JUNK (1)
5
2016-05-30
2016-05-27
No

Hi, I am facing a problem which is independent of dbunit jar versions as I have tried with dbunit-2.0.jar, dbunit-2.2.1.jar, dbunit-2.4.9.jar, dbunit-2.2.3.jar and dbunit-2.3.0.jar and independent of Oracle Database version, as I tried on oracle11g and oracle12c.That the data which I try to insert through xml file into a column of datatype NCLOB for a table , it inserts junk characters which are of no use into the system for further processing.

But if I change the datatype of that column as CLOB it works perfectly fine while using dbunit for Oracle database insertion operation through XML. I am not sure what can be the reason for this behavior.

Our application is supporting NCLOB data insertion through Hibernate engine as well as direct SQL insert query for Oracle database but only insert junk characters while using dbunit setup for test Case execution.

We can't change datatype of that column from NCLOB to CLOB as our application supports multi-languages so we don't want to enforce any character set on this data.

Please suggest, what can be done.

1 Attachments

Discussion

  • Jeff Jensen

    Jeff Jensen - 2016-05-27

    You didn't mention trying any releases newer than 2.4.9 which is from 2012, so I suggest trying the latest version that will release in a week or so, 2.5.3-snapshot. It may not make any difference, but it is the starting point for resolving or improving. Hopefully you can find the problem and submit a patch/merge request.

    Release changes: http://dbunit.sourceforge.net/changes-report.html
    How to access snapshots: http://dbunit.sourceforge.net/repos.html

     
  • HARISH HARISH

    HARISH HARISH - 2016-05-30

    Jeff, Thanks for replying, just now I have tried with dbunit-2.5.2.jar but it is behaving alike other jars as it is inserting junk characters in NCLOB column. I was not able to download maven dependency "2.5.3-SNAPSHOT". is it something well known?if yes, how to go about this?

     
  • Jeff Jensen

    Jeff Jensen - 2016-05-30

    I have tried with dbunit-2.5.2.jar but it is behaving alike other jars

    I'm not surprised there is no difference in newer dbUnit versions as I didn't see any NCLOB related changes for many years in git history.

    The cause is probably one of these:

    1. The NCLOB data format presented to dbUnit via the XML file
    2. A dbUnit issue

    I suggest creating one or more dbUnit tests proving the feature works or doesn't work. This provides an easy case proving either way, and if the test fails, then it also provides an easy way to debug the problem and find the fix.

    To provide the tests and fix, please create a merge request or attach a patch to a bug ticket.

    I was not able to download maven dependency "2.5.3-SNAPSHOT". is it something well known?if yes, how to go about this?

    Did you use the "snapshots" info on this page? http://dbunit.sourceforge.net/repos.html
    I just added the "settings.xml How-To", perhaps that is the info you needed.
    Yes, using Maven snapshots is a standard (well known) feature of it.

     
  • Jeff Jensen

    Jeff Jensen - 2016-05-30
    • status: open --> pending
    • assigned_to: Jeff Jensen