Hi all,
I am new to torque, and I am having some problems with updating values. I am running agains PostgreSQL. When trying to update I get the following error message:
WARNING: COMMIT: no transaction in progress

I have to following java:
Poll p;
Pollquestion pollquestion;:
List pollquestionList ;
pw = (PollWrapper) data.getUser().getTemp("editableobject"); //PollWrapper stores objects
p = pw.getPoll(); //Gets the poll object that will be changed
pollquestion = (Pollquestion) pw.getPollquestions().get(0);
p.setPollname(data.getParameters().get("pollname")); //sets the value from the form/request
p.setActive(data.getParameters().getBoolean("active")); // -||-
pollquestion.setQuestion("Something meaningfull");
try {
p.save(); //saves, but gives the warning.
pollquestion.save(); //Does not get saved, but gives the warning.
} catch (Exception e) {
logger.error("Error saving poll: " + e);
e.printStackTrace();
}

Am I supposed to call some start transaction metod and a commit? I looks like, according to the error/warning message, that postgres receives a commit without being aware of a transaction start! P are persisted, but I have some side effects on this issuse. The PollWrapper object contains the objects related to Poll, the pollquestions. When i work on a PollQuestion I can call save on that a PollQuestion, but is is not stored! The postgres console gives the mentioned warning.
I am lost. Where do I look?

My table definitions are the following:
<table name="Poll" description="Poll">
<column
name="PollID"
required="true"
primaryKey="true"
autoIncrement="true"
type="INTEGER" />
<column
name="PollName"
required="true"
type="VARCHAR"
size="128"/>
<column
name="Active"
default="false"
required="true"
type="BIT"/>
</table>

<table name="PollQuestion" description="Contains related questions to a poll">
<column
name="QuestionID"
required="true"
primaryKey="true"
autoIncrement="true"
type="INTEGER"/>
<column
name="PollID"
required="true"
type="INTEGER"/>
<column
name="Question"
required="true"
type="VARCHAR"
size="254"/>
<foreign-key foreignTable="Poll">
<reference
local="PollID"
foreign="PollID"/>
</foreign-key>
</table>

I hope someone can help, because this is driving me nuts....
/Henrik




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to