• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

persist data

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
A few weeks ago I posted my problem I could not persist my records.
I still have this problem but I fixed some errors.

I have a Form with a few textboxes to make a reservation for a hotel.
It's need your name,firstame, arrival etc...

When I press on my save button it doesnt persist and i dont know why

I put some system.outprintlns to check my function does receive the parameters and it does ....

I worked on this way:

My Reservationcontroller



My ReservationDao



My controllerImplementation



My domain



My view



Thanks!
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so you are saying your Reservation parameter in your Controller POST method is being populated.

You see your printlns show in the console.

Now what about setting a break point? can you do debugging? The thing we have to check is to see if you have a Transaction. If you can set a break point in the first line of your controller method. Then look at the Controller's Dao reference. If in the debugger it says it is being Proxied, then you have a Proxy.

Basically the code looks fine, although I didn't take a fined tooth comb to it.

The other thing you should post is your configuration of your EntityManagerFactory, and also your TransactionManager configuration as well as your DataSource. Also you have <tx:annotation-driven/> in your config?

Mark
 
Arian Zand
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mark Spritzler wrote:OK, so you are saying your Reservation parameter in your Controller POST method is being populated.

You see your printlns show in the console.

Now what about setting a break point? can you do debugging? The thing we have to check is to see if you have a Transaction. If you can set a break point in the first line of your controller method. Then look at the Controller's Dao reference. If in the debugger it says it is being Proxied, then you have a Proxy.

Basically the code looks fine, although I didn't take a fined tooth comb to it.

The other thing you should post is your configuration of your EntityManagerFactory, and also your TransactionManager configuration as well as your DataSource. Also you have <tx:annotation-driven/> in your config?

Mark



Hi Mark, Thanks for your reply

How can I set break points in java?
Sorry I'm a newbie in Java...

In My servlet-Context I config my Entity manager (I set my annotation driven in comment because otherwise i get an error of Element of attribute dont match I need to set a xmlns but i dont know which one:

 
Arian Zand
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PROBLEM SOLVED
I forget adding my xlmns schema and location for my transaction manager
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad you got that solved. Just a word of caution the following 2 lines probably do not behave the way you think:



Merge is different then persist in that it returns the managed entity which may not be the one you passed in. What you probably mean to do is:

 
What are your superhero powers? Go ahead and try them on this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic