Carole Zieler wrote:


I posted question two days ago..and didn't receive any replies on the list. I've just found out my work's mail filter was filtering any emails from this list..and apparently there is no way to stop it..so I've signed up on another email account. I just wanted to make sure that no one had replied directly to me with any information on this...before I looked further into it. Original post below...

-------------------------------------------------------------------

I was wondering if anyone had run into this problem, and if so if there was
a fix in the works (or maybe I'm just doing something wrong).  I've been
working w/ castor for a while, and have recently been told I need to support
SQL Server as well as MySQL(which is what I've been using).  I am using the
opensource jtds driver instead of the SQL Server driver.

I have several tables containing longblob types in MySQL, in the new SQL
Server database I have made them image fields. I am able to load data from
the tables without any problems, but when I try to create an OQLQuery to
create/update records with the image fields, castor does not seem to look at
the SQL type specified in my mapping file, which is set to longvarbinary,
and creates the parameter as a binary field instead, which jtds does not yet
support.


In case I've simply done something wrong..I am including the contents of my
configuration file..and a sample of one table in my mapping file w/ the
image field.

Config File Contents:
<!DOCTYPE databases PUBLIC "-//EXOLAB/Castor JDO Configuration DTD Version
1.0//EN" "http://castor.exolab.org/jdo-conf.dtd";>
<database name="Global" engine="sql-server" >
    <driver url="jdbc:jtds:sqlserver://paybond_dual;SelectMethod=cursor"
            class-name="net.sourceforge.jtds.jdbc.Driver">
         <param name="user" value="test" />
         <param name="password" value="test" />
    </driver>
  <mapping href="mappingGlobal.xml" />
</database>

Mapping file sample:
 <!--  Mapping for XRL  -->
    <class name="mypackage.class"
           identity="id">
      <description>Sample Object</description>
      <map-to table="Sample " xml="Sample " />
      <field name="id" type="integer" >
        <sql name="id" type="integer"/>
        <xml node="attribute"/>
      </field>
      <field name="name" type="string">
        <sql name="name" type="char" dirty="check" />
        <xml node="text" />
      </field>
      <field name="date" type="date">
        <sql name="datestamp" type="date" dirty="check" />
        <xml node="text" />
      </field>
      <field name="SampleImage" type="bytes">
            <sql name="SampleImage" type="longvarbinary" dirty="ignore" />
            <xml node="text" />
      </field>
  </class>


I have just downloaded the latest code and if anyone can confirm it's a bug..I look into it and see if I can find the problem, but as I'm unfamiliar w/ the code as of yet, if someone could point me in the right direction as to where I might want to look for the problem...that would be great. Or if there is a simple workaround..I'd be happy for that too.

Carole,


Creating and updating data via Castor is not accomplished via OQL. This is done via calls to db.create( object ) and either db.commit() or db.update( object ) (NOTE: db.update( object ) is only used with long transactions). So I'm not sure if I follow your description above. Please elaborate on the problem further by providing snippets of relevant source code.

When Castor is reading data from persistence, the longvarbinary, varbinary and binary types are all handled the same - java.sql.ResultSet.getBytes( columnIndex ) is called to retrieve the data. You're not having any trouble reading data, are you?

I've never used SQL Server and I don't have access to it. I can definitely provide some advice that you will need to use to troubleshoot and diagnose the problem and let us know the results.

Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'


The Castor Project
http://www.castor.org/

Apache Geronimo
http://incubator.apache.org/projects/geronimo.html

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev




Reply via email to