Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

persist data

 
Arian Zand
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!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 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:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic