Ben,
<param server-name="host" database-name="db" .../> works for me. However it
seems as if db.update for a long transaction creates a new object as opposed
to updating the existing one. Are you seeing the same thing?
I use the XADataSource with key-generator="IDENTITY" with auto-increment
field and also tried it with the MAX key-generator.
thanks.
----- Original Message -----
From: "Ben Wilcock" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 12, 2002 3:19 AM
Subject: [castor-dev] problems configuring a MySql Xa DataSource to work
with Castor
> Hi All,
>
> Thanks for the suggestions on getting over the rollback problem. I thought
I would try and use the XADataSource that comes with Mark Matthews MySQL
JDBC Driver to overcome the Transaction Rollback issue, but I've hit another
problem. Anyone had this before?
>
> I get a PersistenceException with the root cause being an SQL Exception
from the MySql driver claiming that there was "No Database Specified".
>
> The database.xml I am using looks something like this...
>
> <database name="configManager" engine="mysql">
> <data-source
class-name="org.gjt.mm.mysql.jdbc2.optional.MysqlXaDataSource">
> <params user="user" password="secret" serverName="localhost" port="3306"
databaseName="configManager" />
> </data-source>
> <mapping href="mapping.xml" />
> </database>
>
> I used to use the Driver config rather than the Datasource config for the
same databse, and with the same params everything worked OK. The attribute
names I used in the params tag (serverName, port and databaseName) are the
accessor methods for the datasource.
>
> Just a thought, but is it that I need to use specific param names
specified by castor rather than by the driver as I have done? (like you have
in the examples for Sybase and PostgreSQL) for example...
>
> <params server-name="host" port-number="5432" database-name="db"
user="user" password="secret" />
>
> Any other suggestions are most welcome?
>
> Cheers
>
> Ben
>
> PS. Just a small thing I noticed - in the documentation in this area
(database-conf.html), the data-source example has the params in a param tag,
but the DTD forced me to use the params tag for datasources. The "s" would
seem to be missing in the docs.
>
> The DataSource implementation class name is specified by the class-name
attribute and configured through Bean-like accessor methods specified for
the param element. The DTD for the param element is undefined and depends on
the DataSource being used.
> <data-source class-name="org.postgresql.PostgresqlDataSource">
> <param server-name="host" port-number="5432" database-name="db"
user="user" password="secret" />
> </data-source>
>
>
>
>
> Ben Wilcock
> Application Developer
>
> Symularity Limited
> 1 John Charles Way,
> Geldered Road,
> Leeds, LS12 6LY
>
> Email: [EMAIL PROTECTED]
> Tel: 0113 220 5460
>
> PRIVACY & CONFIDENTIALITY NOTICE
>
> The information contained in this e-mail is intended for the named
recipients only. It may contain privileged and confidential information. If
you are not the addressee or the person responsible for delivering this to
the addressee, you may not copy, distribute or take action in reliance on
it. If you have received this e-mail in error, please notify us immediately
by returning the original message to the sender by e-mail.
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
>
>
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev