insert.execute() writes truncated strings

1927
6
06-19-2012 05:23 AM
FlavioPompermaier
New Contributor
Hi to all,
I'm using Oracle 11g (64 bit) on Linux and SDE 9.3.1 (32 bit) on Windows Server 2003 SP2.
In my Java application I want to add features to my SDE layer but string fields seems to be not correctly handled.

In my layer I have a VARCHAR2(32 bytes) field and every time I write a value its last character get lost (e.g. I want to insert 'username' but in my table I found 'usernam').
I use SeRow.setString(index,string) and Inser.execute() for doing my job.

Can anyone help me?

Best regards,
Flavio
0 Kudos
6 Replies
VinceAngelo
Esri Esteemed Contributor
Are you using the 9.3.1 terminal service pack (SP2)?  If not, you should upgrade to that first.

- V
0 Kudos
FlavioPompermaier
New Contributor
Yes I did it. However this error occurs on every sde installation, from 8.3 to 9.3.1..Maybe it's related to the column definition..maybe sde doesn't like VARCHAR2(32 bytes) in oracle..
0 Kudos
VinceAngelo
Esri Esteemed Contributor
It's more likely to be linked to your character set, but this is really something to address with
Tech Support.

- V
0 Kudos
FlavioPompermaier
New Contributor
My db encoding is AL32UTF8 in one db and in another is WE8MSWIN1252.
0 Kudos
AdamWasiak
New Contributor

Hi Flavio,

I am having exactly the same problem with stings being truncated via SeRow.setString(index,string). I just wondered if you found a solution for this?

It was working fine with SDE 9.1 on Oracle 10g but we've just upgraded to SDE 10.1 and have found this problem.

Next stop is Tech Support, but just thought I'd see how you got on first.

Thanks,

Adam

0 Kudos
AdamWasiak
New Contributor

I just thought I'd share my solution, in case anyone else has this problem in the future.

The problem was actually caused by conflicting class files. While we had the 10.1 sdk jar files on the class path, what we didn't notice immediately was that the JAVA_HOME was set to an old installation of java that came with ArcIMS, which in turn had old 9.1 sdk jar files in the lib/ext folder. Interestingly most of our system appeared to work fine like this, with the one exception as reported. Simply moving JAVA_HOME to a fresh install of Java that had nothing to do with ArcIMS (and hence no ESRI jar files in lib/ext) fixed the problem.

So, if you are having this problem, take a look in $JAVA_HOME/lib/ext and see if there are any ESRI jar files conflicting with your classpath (or look for multiple sdk versions on your classpath).

I hope this helps someone in the future.

Thanks,

Adam

0 Kudos