[jboss-user] [EJB 3.0] - javax.ejb.EJBTransactionRolledbackException due to @In @Out
kaviarasu
do-not-reply at jboss.com
Mon Sep 10 03:23:02 EDT 2007
Hi im using a primary and secondry table.
the user wants to write a review which is inserted into the secondry table and he has the option to edid his review.
when i use @Out annotation to the secondry table the user cant able to write into the database it giving the error
Caused by: javax.ejb.EJBTransactionRolledbackException
if i remove the @out annotation write review is working but editing the review is not working
In my bean i declared the coding as
TblReviews is primary table
TblUserReviews is secondry table
@RequestParameter
| BigDecimal revid;
| @In(required=false)
| TblReviews tr=new TblReviews();
| @In(required=false)
| @Out(required=false)
| TblUserReviews tblu;
| @Out(required=false)
| List<TblUserReviews> editreview;
public String register() {
| tr.setProductId(pro);
| tr.setUserId(identity.getUsername());
| Set<TblUserReviews> tblUserReviewsCollection= new TreeSet<TblUserReviews>();
| tblu.setReviewEntryId(tr);
| tblUserReviewsCollection.add(tblu);
| tr.setTblUserReviewsCollection(tblUserReviewsCollection);
| em.persist(tr);
| return "/prodis.xhtml";
| }
public String edit() {
| em.merge(tblu);
| return "/prodis.xhtml";
| }
public void editReview(){
| editreview= (List<TblUserReviews>) em.createQuery("select p from TblUserReviews p where userReviewId="+revid+"").getResultList();
| tblu = (TblUserReviews) editreview.get(0);
|
| }
write review page
Code:
| <h:inputTextarea value="#{tblu.reviewSummary}" style="width : 445px; height : 109px;"/>
| <h:commandButton value="Submit Review" action="#{search.register}" type="submit"/>
edit review page
<h:inputTextarea value="#{tblu.reviewSummary}" style="width : 445px; height : 109px;"/>
| <h:commandButton value="Submit Review" action="#{search.edit}" type="submit"/>
i need this urgent
thanking u
regards
kaviarasu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082480#4082480
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082480
More information about the jboss-user
mailing list