• 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 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.
 
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 ]
 
On top of spaghetti all covered in cheese, there was this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!