[JBoss Seam] - EntityManager null
by srpantano
I made:
| <component name="em" auto-create="true" class="org.jboss.seam.core.ManagedPersistenceContext">
| <property name="persistenceUnitJndiName">java:/data</property>
| </component>
|
| <component name="org.jboss.seam.ui.entityConverter">
| <property name="entityManager">#{em}</property>
| </component>
|
| <component name="roles" class="org.jboss.seam.framework.EntityQuery">
| <property name="ejbql">select r from Role r</property>
| </component>
|
but when I run the facelet page with:
| <h:selectOneMenu value="#{list.roles}" required="true">
| <s:selectItems value="#{roles.resultList}" var="role" label="#{role.descricao}" noSelectionLabel="Please Select..."/>
| <s:convertEntity />
| </h:selectOneMenu>
|
but the result is:
java.lang.IllegalStateException: entityManager is null
please, I´m missing something?
PS.: I´m using Seam 1.2.1GA, Jboss 4.2.0ga and facelets 1.12
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048045#4048045
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048045
18 years, 11 months
[JBoss Seam] - EntityHome for nested entity CRUD?
by kingcu
Hi,
I have an entity named Business defined as below:
@Entity
| public class Business {
|
| @ManyToOne(fetch = FetchType.EAGER)
| @JoinColumn(name = "PARENT_BUSINESS_ID", nullable = true)
| private Business parentBusiness;
|
| @OneToMany(fetch = FetchType.LAZY)
| @JoinColumn(name = "PARENT_BUSINESS_ID", nullable = true)
| private List<Business> childBusinesses = new ArrayList<Business>(0);
|
| ...
| }
|
As you can see, the Business has a one-to-many (parent to children) relation with itself. I am trying to use EntityHome to simply the CRUD code and ideally, it will only need a single BusinessEdit.xhtml page and a single BusinessHome class. The part where I got stuck is how the child BusinessHome object will get a reference to the parent Business instance, which is needed in the child BusinessHome's wire().
In a non-nested one-to-many relation, e.g. EntityA (1) <----> EntityB (N), EntityAHome can be injected into EntityBHome because two EntityHome component will have different names. However, in my case, parent and child Home instances have the same name and are in different conversations.
Any idea that this can be done in an elegant way?
Thanks in advance.
wt
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048044#4048044
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048044
18 years, 11 months
[JBoss Messaging] - Re: automatically truncate message table on server startup
by paul_da_programmer
"timfox" wrote : If you are using only non persistent messages, then there is nothing to "back out" from the DB, since nothing has been saved to the db.
|
| Perhaps I don't follow what you are trying to say...
What I want to back out (or commit atomically) is the XA DB work that my biz functionality has done - using 2PC prepare,ack, commit semantics. If the JMS implementation is an XA compliant one, even without persistence then the answer is yes.
I'm thinking this is the sequence of events
1. TX manager starts a new XA transaction
2. JMS (since its XA) enrolls in the transaction.
3. onMsg is invoked, 2 Oracle XA DS are updated, DS1 and DS2. Both are enrolled in the same transaction.
4. onMsg returns successfully (so far so good)
5. the TX Manager calls prepare on all 3 resources JMS, DS1, DS2
6. the TX Mananger receives OK from all three resources
7. the TX Manager calls commit on all 3 resources JMS, DS1, DS2
8. whoops, DS2 commit fails - and notifies TX Manager
9. the TX Manager calls rollback on all 3 resources
If JMS if not a XA resource it will not honor the rollback at the last step and would cause the DB updates to never be applied.
I hope this explains my motivation...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048038#4048038
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048038
18 years, 11 months