title: JPA: accented character is saved as ? in database
body: <p>Our application is running on weblogic 10g and persists data into oracle 9 database via JPA backed by default eclipselink implementation.</p>
  
  <p>Entity is simple:</p>
  
  <pre><code>@Entity
  @Table(name="PLUGINDATA")
  @SequenceGenerator(name="plugin_seq", sequenceName="PLUGINDATASEQ", initialValue = 1000, allocationSize = 50)
  public class PluginData implements Serializable {
      @Column(name = "data", length = 4000, nullable = false)
      private String data;
  
  @PersistenceContext(unitName = "XYZ")
  protected javax.persistence.EntityManager entityManager;
  
  entityManager.persist(entity);
  </code></pre>
  
  <p>When I pass string containing accented characters, they are OK in EJB:</p>
  
  <pre><code>83, 116, -59, -103, 101, 100, 111, -60, -115, 101, 115, 107, -61, -67, 32, 107, 114, 97, 106
  </code></pre>
  
  <p>but they are stored corrupted in database:</p>
  
  <pre><code>83, 116, 63, 63, 101, 100, 111, -60, 63, 101, 115, 107, 63, 63, 32, 107, 114, 97, 106
  </code></pre>
  
  <p>e.g. accented characters are replaced by question mark: <code>St??edo�?esk?? kraj</code></p>
  
  <p>I do not understand it, the code is OK and datasource setting is same like for other applications that work correctly. Any idea?</p>
  
  <p>Edit 1:</p>
  
  <p>This is SID NLS setting (very same like another application database)</p>
  
  <pre><code>select DECODE(parameter, 'NLS_CHARACTERSET', 'CHARACTER SET', 'NLS_LANGUAGE', 'LANGUAGE', 'NLS_TERRITORY', 'TERRITORY') name, value 
  from v$nls_parameters
  where parameter in ('NLS_CHARACTERSET', 'NLS_LANGUAGE', 'NLS_TERRITORY');
  
  LANGUAGE    ENGLISH
  TERRITORY   CZECH REPUBLIC
  CHARACTER SET   EE8ISO8859P2
  </code></pre>
  
  <p>Edit 2:</p>
  
  <p>WebLogic / Data source</p>
  
  <p>Connection pool tab has following attributes:</p>
  
  <pre><code>URL: jdbc:oracle:thin:@hostname:1521:SID 
  Driver: oracle.jdbc.xa.client.OracleXADataSource
  </code></pre>
  
  <p>Oracle tab: everything is unchecked</p>