[jboss-user] [JBoss Seam] - Re: cant figure out why my transaction is null : same code w

wiggy do-not-reply at jboss.com
Fri Feb 8 18:34:37 EST 2008


okay can any one help on this.  

I've imported the same code base onto my pc at home - think i have the same config but it works fine 

at home i stall have the persistence.xml as 

  | <persistence xmlns="http://java.sun.com/xml/ns/persistence" 
  |              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |              xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
  |              version="1.0">
  |              
  |    <persistence-unit name="WillsSeamProject">
  |      <provider>org.hibernate.ejb.HibernatePersistence</provider>
  |       <jta-data-source>WillsSeamProjectDatasource</jta-data-source>
  |       <properties>
  |          <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
  |          <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
  |          <property name="hibernate.show_sql" value="true"/>
  |          <property name="hibernate.format_sql" value="true"/>
  |          <property name="jboss.entity.manager.factory.jndi.name" value="java:/WillsSeamProjectEntityManagerFactory"/>
  |       </properties>
  |    </persistence-unit>
  | 

and the nodeHome java is - which is still a POJO component - 


  | 
  | @Name("nodeHome")
  | public class NodeHome extends EntityHome<Node>
  | {
  | 
  |     @RequestParameter 
  |     Long nodeId;
  | 
  |     @RequestParameter 
  |     String reasonForLink;
  | 
  |     @Factory("node")
  |     public Node initNode() {return getInstance();}
  |     
  |     @Override
  |     public Object getId() 
  |     { 
  |         if (nodeId==null)
  |         {
  |             return super.getId();
  |         }
  |         else
  |         {
  |             return nodeId;
  |         }
  |     }
  |     
  |     @Override @Begin
  |     public void create() {
  |         super.create();
  |     }
  |  	
  |     /*
  |      * action to link two nodes
  |      * 
  |      */
  |     public Link addLinkToNode (Node otherNode)
  |     {
  |     	Link newLink ;
  |     	
  |     	newLink = this.getInstance().addLinkTo(otherNode);
  |     	if (reasonForLink != null)
  |     	{
  |     		newLink.setDescription(reasonForLink);
  |     		newLink.setLastUpdated();
  |     	}
  |     	this.getInstance().setLastUpdated();
  |     	this.update();
  | 
  |     	return newLink;
  | 
  |     }
  | }
  | 

with .html client as 


  | 
  | <ui:composition xmlns="http://www.w3.org/1999/xhtml"
  |                 xmlns:s="http://jboss.com/products/seam/taglib"
  |                 xmlns:ui="http://java.sun.com/jsf/facelets"
  |                 xmlns:f="http://java.sun.com/jsf/core"
  |                 xmlns:h="http://java.sun.com/jsf/html"
  |                 xmlns:rich="http://richfaces.org/rich"
  |                 template="layout/template.xhtml">
  |                        
  | <ui:define name="body">
  |     
  |     <h:messages globalOnly="true" styleClass="message"/>
  |     
  |     <h:form id="nodeForm">
  | 
  |         <rich:panel>
  |             <f:facet name="header">node</f:facet>
  |     
  |             <s:decorate id="nameDecoration" template="layout/edit.xhtml">
  |                 <ui:define name="label">Name</ui:define>
  |                 <h:inputText id="name" required="true"
  |                              value="#{node.name}"/>
  |             </s:decorate>
  |             
  |             <div style="clear:both"/>
  |             
  |         </rich:panel>
  | 
  |         <div class="actionButtons">
  |             <h:commandButton id="save" 
  |                           value="Save" 
  |                          action="#{nodeHome.persist}"
  |                        rendered="#{!nodeHome.managed}"/>                   
  |             <h:commandButton id="update" 
  |                           value="Update" 
  |                          action="#{nodeHome.update}"
  |                        rendered="#{nodeHome.managed}"/>                  
  |             <h:commandButton id="delete" 
  |                           value="Delete" 
  |                          action="#{nodeHome.remove}"
  |                        rendered="#{nodeHome.managed}"/>
  |             <s:button propagation="end" 
  |                                id="done" 
  |                             value="Done"
  |                              view="/nodeList.xhtml"/>
  |         </div>
  |         
  |     </h:form>
  |     
  | </ui:define>
  | 
  | </ui:composition>
  | 
  | 

but somehow this config works - and my works one doesnt !

i'd swear i cant see the difference but the error code at work shows differently - has any one got a clue from the trace error on the first post as to what might be going on?



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128024#4128024

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128024



More information about the jboss-user mailing list