This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

insert does not work  RSS feed

 
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
 
author and cow tipper
Posts: 5000
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.
 
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 ]
 
I didn't like the taste of tongue and it didn't like the taste of me. I will now try this tiny ad:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!