Pa3u3u / Surreal-Travel

Travel Agency System
0 stars 0 forks source link

Problem with colection in jsp. #25

Closed kiclus closed 9 years ago

kiclus commented 9 years ago

I program all day tehe next milestone, but now I have a problem and I can fix it now. it is the problem with colection im my reservation, every time I get this exception. org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: cz.muni.pa165.surrealtravel.entity.Reservation.excursions, could not initialize proxy - no Session org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) in some forum I find something but it doesn work in my code.http://stackoverflow.com/questions/11746499/how-to-resolve-failed-to-lazily-initialize-a-collection-of-role-exception In Trip There are colection to, Roman have you same problem like me???

Pa3u3u commented 9 years ago

Anyway, is anyone fixing the deleteReservation method in ReservationController? If not, I will look at that... but first I need to get home, I'm still at work and they are going to banish me from these lands by 20.00 :cry:

FiXerCz commented 9 years ago

I am already brain damaged so it was a safe bet.

I did not even know deleteReservation is broken so you can do it. My battery is running low, I will need break from java soon :)

Pa3u3u commented 9 years ago

Well, it works, but ... that bipas is ... eh, it needs to be fixed.

kiclus commented 9 years ago

thank guys i own you big caps of bears. if is the reservationService.getReservationById(id) fix , in can only remove the bipas and it will be ok.. I wil look at it.

FiXerCz commented 9 years ago

bipas is already removed in the currently versioned code :) If i did not forget to push it

kiclus commented 9 years ago

yes he is removed in all function but it is still in deletereservation in reservationController

kiclus commented 9 years ago

if you have removed it from delete and dot push it, please push :-D. or I will delete it

kiclus commented 9 years ago

I fix it may I Push it??

FiXerCz commented 9 years ago

I did not modify delete method. I am however still finishing edit and Roman said, I believe, that he would fix delete method, so I think that is all that that needs finishing on ReservationCOntoller.

kiclus commented 9 years ago

ok I dont push it it is only remove the //bipas// inside the coment and one line after the bipas(redundant)

Pa3u3u commented 9 years ago

All right, I'm at dorm and ready to check the code. Please push all pending commits that you might have. If I find small errors, I will fix them directly (we don't have time to waste with issues, right?)

FiXerCz commented 9 years ago

Finally. I think that my part is done.

ReservationController now supports both adding and editing.

Roman, you will fix delete method? Or how did we decide this?

Pa3u3u commented 9 years ago

Yes, I will (if you mean what I meant before :smiley:)

kiclus commented 9 years ago

ok guye push it, after that I only add one think to validator because I have nothing here (reservation everything have in selection or ribonbutton) there aro nothing to validate , but il looks dum there are nothing in validator.

FiXerCz commented 9 years ago

I removed that validator as it was not neccessary. I did tell you in the afternoon that I would finish your controller, so I made lot of changes, sorry :)

kiclus commented 9 years ago

oh ok

Pa3u3u commented 9 years ago

Oh, I see. I wrote earlier that it's not really feasible, as these exceptions get wrapped in JpaSomethingException (which is actually very interesting, as @Transactional at service layer should wrap them into DataAccessException) and unwrapping several layers of exception is not really a way to do things. I think we should simply display ex.getMessage() (that's what I mean to do).

FiXerCz commented 9 years ago

Can I change one word in CustomerController? I forgot to change one string from failure to success :D

Pa3u3u commented 9 years ago

Yeah, go ahead

FiXerCz commented 9 years ago

Alright, done.

Pa3u3u commented 9 years ago

One more thing - as I'm not a native Czech speaker, I could have made some errors in messages. Would you please check all trip.* keys?

kiclus commented 9 years ago

I do it, but I am not goot in language :-D

Pa3u3u commented 9 years ago

I meant @FiXerCz , but you can check the English version if you want :smirk:

FiXerCz commented 9 years ago

Sure, I'll take a look at it :)

kiclus commented 9 years ago

only datum/dátum fix I read it tooo late it si pushed

Pa3u3u commented 9 years ago

A quick curiosity: It is possible to create a trip with some excursions, then edit the excursion in such a way that it would happen before or after the trip.

Don't mind that, there is actually no easy way how to "fix" it except than freezing the date in the edit form, but bugger that I say :smiley:

EDIT: Actually, there is one. And rather easy, I will include it.

FiXerCz commented 9 years ago

There 2 more untranslated words in Czech translation file. Already pushed it. Grammar seems ok.

That curiosity could be fixed probably by checking all trips that the excursion is part of when modifying that excursion. And comparing dates. Sound like a drag. I say, people working with our system must be responsible and not do reckless edits :smile:

Pa3u3u commented 9 years ago

This is exactly what I meant :smiley: And it's actually very short. But I'm checking your code now, mainly, I'm interested in that checkFormErrors, that returns its second argument, which is then compared to null and returned :smiley:

FiXerCz commented 9 years ago

Yeah, I was writing it in the dark times :D

FiXerCz commented 9 years ago

Lol that is a crapload of horse shit. Should I fix or you want to do it yourself?

Pa3u3u commented 9 years ago

I am doing some edits in other codes, so I will fix it, I don't want to solve merge issues 5 minutes before deadline :smiley:

FiXerCz commented 9 years ago

It should return true if there was some error (some boolean variable that would be defaultly false, if some of the 2 cycles would be iterated then it would be set to true and then returned). I was probably quite tired, when I was writing it :)

FiXerCz commented 9 years ago

Really have no idea wy did I write it in this way...

Pa3u3u commented 9 years ago

So, it would always return true, as it is called under condition that there are some errors, right? The actual return type should be void then...

FiXerCz commented 9 years ago

RIght you are. I am not going to say anything else since it would probably again be wrong. It is too late in the night for me.. Anything you want to ask me should be mediated through my lawyer... As soon as I get one... :smile:

Pa3u3u commented 9 years ago

Update: I'm not asleep; I'm finalizing the last class (mainly I'm unifying error outputs and messages :smiley: + in some classes, some errors are not covered and the page would simply redirect to itself). Just 10 more minutes

FiXerCz commented 9 years ago

Ok. Looks like it will be a close one with this milestone :-)

Pa3u3u commented 9 years ago

I'm done. One last test and I will commit it. Still have 10 minutes, I might make myself a tea :smiley:

Pa3u3u commented 9 years ago

Pushed, it compiles remotely. Now that I look at it, I wonder why there is nothing in "Main page", "About us" and god, those lame demo entities will haunt me this night :smiley: EDIT: Tried to run on the server, works "smoothly", errors are reported, I think we did it... :tada: