Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

insert does not work

 
Diego Garcia
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I am trying to make an insert but nothing happens in my database. This is my User class:





my mapping file:





this is my insert makePersistent() method:




Can someone help me? Any idea of what is going on?

Thanks in advance
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where do you begin the transaction?

Any SQL in your console output? Any error messages?




-Cameron McKenzie
 
Diego Garcia
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,

Thanks for the response, Cameron.

Here is where i begin the transaction:



and the constructor in WebUserDAO:



and my hibernate generated sql:


Any idea? Thanks again

[ June 26, 2008: Message edited by: Diego Garcia ]

[ June 26, 2008: Message edited by: Diego Garcia ]
[ June 26, 2008: Message edited by: Diego Garcia ]
 
Diego Garcia
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I am still stuck at this...i have been reading and i have a question:

Could it be possible that i need a version element added to the mapping file (and a version instance variable)?

Any thoughts? thanks in advance.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only if you want to use Hibernate's optimistic locking mechanism. It is optional.

Where do you commit your transaction?
[ July 08, 2008: Message edited by: Paul Sturrock ]
 
Diego Garcia
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul, for your interest.

I commit my transaction in my makePersistent() method:



[ July 08, 2008: Message edited by: Diego Garcia ]
[ July 08, 2008: Message edited by: Diego Garcia ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic