You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Sez Sez <se...@yahoo.es> on 2004/04/05 13:16:58 UTC
Problems with save
Hi!
I have a problem when save a information with a
torque, with 3.0.2 version.
If i try to save with method save(connection con), it
will do correctly.
If i try to save wiht method save(String
name_conneciton) or save(), it will give me this
error:
"Connection object was null. This could be due to a
misconfiguration of the DataSourceFactory. Check
logs...
The code is here
public void save(String dbName) throws
TorqueException
{
Connection con = null;
try
{
con = Transaction.begin(dbName);
save(con);
Transaction.commit(con);
}
catch(TorqueException e)
{
Transaction.safeRollback(con);
throw e;
}
}
This code is generated by torque.
___________________________________________________
Yahoo! Messenger - Nueva versión GRATIS
Super Webcam, voz, caritas animadas, y más...
http://messenger.yahoo.es
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org
Re: Problems with save
Posted by Kostyantyn Shchekotykhin <ko...@ifit.uni-klu.ac.at>.
Hi Sez,
possibly the problem is in that you should provide a correct databse name of your datebase as it was set in your Torque
properties. In your message you have written save(String name_conneciton).
Maybe that will help.
Regards,
Kostya
Sez Sez wrote:
> Hi!
> I have a problem when save a information with a
> torque, with 3.0.2 version.
>
> If i try to save with method save(connection con), it
> will do correctly.
> If i try to save wiht method save(String
> name_conneciton)
> or save(), it will give me this
> error:
> "Connection object was null. This could be due to a
> misconfiguration of the DataSourceFactory. Check
> logs...
>
> The code is here
>
> public void save(String dbName) throws
> TorqueException
> {
> Connection con = null;
> try
> {
> con = Transaction.begin(dbName);
> save(con);
> Transaction.commit(con);
> }
> catch(TorqueException e)
> {
> Transaction.safeRollback(con);
> throw e;
> }
>
> }
>
> This code is generated by torque.
>
> ___________________________________________________
> Yahoo! Messenger - Nueva versión GRATIS
> Super Webcam, voz, caritas animadas, y más...
> http://messenger.yahoo.es
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org
RE: Problems with save
Posted by Daniel Huang <da...@cisco.com>.
Your database mapping is probably not set up correctly. In your
project-schema.xml, do you have the name attribute of database element
assigned to your database name correctly?
Regards,
Daniel
-----Original Message-----
From: Sez Sez [mailto:sezmillenium@yahoo.es]
Sent: Monday, April 05, 2004 4:17 AM
To: torque-user@db.apache.org
Subject: Problems with save
Hi!
I have a problem when save a information with a
torque, with 3.0.2 version.
If i try to save with method save(connection con), it
will do correctly.
If i try to save wiht method save(String
name_conneciton) or save(), it will give me this
error:
"Connection object was null. This could be due to a
misconfiguration of the DataSourceFactory. Check
logs...
The code is here
public void save(String dbName) throws
TorqueException
{
Connection con = null;
try
{
con = Transaction.begin(dbName);
save(con);
Transaction.commit(con);
}
catch(TorqueException e)
{
Transaction.safeRollback(con);
throw e;
}
}
This code is generated by torque.
___________________________________________________
Yahoo! Messenger - Nueva versión GRATIS
Super Webcam, voz, caritas animadas, y más...
http://messenger.yahoo.es
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org