[prev in list] [next in list] [prev in thread] [next in thread]
List: castor-user
Subject: Re: [castor-user] 'PersistenceException: non persistence capable'
From: Ralf Joachim <ralf.joachim () syscon-world ! de>
Date: 2005-11-28 10:16:29
Message-ID: 438AD8FD.7000701 () syscon-world ! de
[Download RAW message or body]
Hi Yuri,
we had a problem with sequence key generator that apears in 0.9.9 and
0.9.9.1 releases of Castor. The problem is tracked by:
http://jira.codehaus.org/browse/CASTOR-1264
and has been resolved in CVS some days ago. As the exception you get is
a different one and max key generator also failed for you i think you
are hit by something else. I can not see any mistake in the information
you provided. For me it looks like your mapping have not been loaded.
Can you please also post your jdo-conf.xml and the code how you
initialized 'connection' which should be an instance of Database interface?
Regards
Ralf
Yuri Green schrieb:
> Hi everyone,
>
> As a simple test before I wired up the rest of my code to use Castor I set
> up a simple table in my Oracle server with two columns in it to test JDO and
> make sure everything was copasetic. As it stands, I can't seem to get a
> class defined in my mapping file to use a key-generator I defined for an
> existing sequence in Oracle. I even tried all of the other algorithms like
> MAX with no success. I'm in a real bind here because without the ability to
> create or use a built-in auto-incrimination system here it renders the
> persistence framework useless. Here's the SQL for my test table and the
> related sequence:
>
> CREATE TABLE test (
> id VARCHAR2(32) PRIMARY KEY,
> test_field VARCHAR2(32) NOT NULL
> );
>
> CREATE SEQUENCE test_id_seq INCREMENT BY 1 START WITH 1;
>
> Here's what's in my mapping.xml file:
>
> <key-generator name="SEQUENCE" alias="A">
> <param name="sequence" value="test_id_seq"/>
> </key-generator>
>
> <class name="com.sourceout.db.object.Test" identity="id" key-generator="A">
> <description>test table</description>
> <map-to table="test" />
> <field name="id" type="string">
> <sql name="id" type="varchar" />
> </field>
> <field name="testField" type="string">
> <sql name="test_field" type="varchar" />
> </field>
> </class>
>
> Here's the contents of com.sourceout.db.object.Test:
>
> public class Test
> {
> String id = null;
> String testField = null;
>
> public Test() {
>
> }
>
> /**
> * @return Returns the id.
> */
> public String getId() {
> return id;
> }
>
> /**
> * @param id The id to set.
> */
> public void setId(String id) {
> this.id = id;
> }
>
> /**
> * @return Returns the testField.
> */
> public String getTestField() {
> return testField;
> }
>
> /**
> * @param testField The testField to set.
> */
> public void setTestField(String testField) {
> this.testField = testField;
> }
> }
>
> When I try to run my test code:
>
> Test test = new Test();
> test.setTestField("some test data");
>
> connection.begin();
> connection.create(test);
> connection.commit();
> connection.close();
>
> I get:
>
> PersistenceException: non persistence capable: com.sourceout.db.object.Test
>
> Now this seems like the most vanilla test I can run and I've been sifting
> through bug reports and the documentation all day trying to find an answer
> but with no luck at all. The idea here seems simple, just set the "id" field
> using a key-generator or a predefined Oracle trigger so that the coder
> doesn't have to know about the current value of the id field to do a simple
> insert with the interesting data. I can't even get the pre-existing Oracle
> side trigger approach to work by sticking in a <param name="trigger"
> value="true"/> info my <key-generator> definition and loading up the trigger
> PL/SQL.
>
> I'm in a real bind here. Is this a known bug that's getting worked on
> because I didn't see anything specific to my example in the bug database. No
> one else seems to be experiencing this so am I doing something wrong or am I
> the first to try this in this environment?
>
> Yuri Green
> CTO
> sourceOut Inc.
> e: yuri@source-out.com
> c: 510.305.8634
>
>
> -------------------------------------------------
> If you wish to unsubscribe from this list, please
> send an empty message to the following address:
>
> user-unsubscribe@castor.codehaus.org
> -------------------------------------------------
--
Syscon Ingenieurbüro für
Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
D-72127 Kusterdingen
Germany
Tel. +49 7071 3690 52
Mobil: +49 173 9630135
Fax +49 7071 3690 98
Email: ralf.joachim@syscon-world.de
Web: www.syscon-world.de
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
user-unsubscribe@castor.codehaus.org
-------------------------------------------------
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic