DynamicQL: Disabling Read-Ahead for Relations
by Christian Nolte
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
I am using JBoss 4.0.4GA and have some troubles using DynamicQL. I have
two entities A and B which have a n:m relation. As I need a dynamical
sized set of entities from A, selected by n-many PKs, I use DynamicQL to
dynamically create a statement like this:
SELECT OBJECT(a) FROM A as a WHERE a.pk IN (?1, ..., ?n)
?1, ..., ?n are generated by iterating over the collection with the PKs
which shall be selected. This works like expected and without any
problem for me.
Like I understand from reading the server.log and the DEBUG-logs in it,
the entity locals are implicitly preloaded by default (on-load) with a
page-size of n (read-ahead), even if I have not definied this behaviour
in jbosscmp-jdbc.xml. If I explicitly define a page-size of 1 for this
query, only one local is loaded at a time when it is accessed (like the
default lazy-loading behaviour for every EJB QL query). This is not what
I want, but I experimented with it. I want to pre-load every entity
which is found by the mentioned query.
The problem now is, that if I access the relation from A to B:
AEntityLocal a = ...
a.getBs();
and pre-loading is enabled, JBoss implicitly pre-loads all relations for
every pre-loaded entity. This is *not* what I want, because this results
in very huge statements. In this special case B has BLOBs in it and so
these are pre-loaded too. What I want is that every relation A has to
other entities are not pre-loaded.
So: Is there a way to explicitly disable this behaviour for DynamicQL?
Best regards!
Christian
- --
For more than 4 generations the IT Professionals were the guardians
of quality and stability in software. Before the dark times.
Before Microsoft...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFGy+UzCNjA0nfhW7wRArY6AJ4ugu/w80XdzMEOledcGdWnWwG4mACglwDr
Uar6eKwqKbdbtGUbqWqKCOE=
=4w0H
-----END PGP SIGNATURE-----
18Â years, 8Â months
[JBoss Seam] - Exception when i want to fill a form !!
by yohann49
Hello !!!
I have a little problem. I'am developping a web application (with Netbeans, glassfish and hibernate). In a page, the client must fill a form and when I click on the button, there is this exception :
Exception during request processing: javax.servlet.ServletException: /abonnement_contact.xhtml @45,70 value="#{contactel.firstName}": Target Unreachable, identifier 'contactel' resolved to null
my jsf page :
| <?xml version='1.0' encoding='UTF-8' ?>
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:f="http://java.sun.com/jsf/core">
|
| <body>
|
| <ui:composition template="templates/client.xhtml">
|
| <ui:define name="servicesclients">
|
| <h:form>
| <h3>Please fill the Contact form</h3>
|
| <h:dataTable id="contact" value="#{conts}" var="cont" rendered="#{cont.size>0}">
| <h:column>
| <f:facet name="header">Contacts</f:facet>
| <h:outputLabel value="#{cont.firstName} #{cont.lastName}"/>
| </h:column>
| </h:dataTable>
|
|
| <h:panelGrid columns="2">
| <h:outputLabel value="FirstName :"/>
| <h:inputText value="#{contactel.firstName}"/>
| <h:outputLabel value="LastName :"/>
| <h:inputText value="#{contactel.lastName}"/>
| <h:outputLabel value="Phone :"/>
| <h:inputText value="#{contactel.phone}"/>
| <h:outputLabel value="Other Phone :"/>
| <h:inputText value="#{contactel.otherPhone}"/>
| <h:outputLabel value="Mail :"/>
| <h:inputText value="#{contactel.mail}"/>
| <h:outputLabel value="Username :"/>
| <h:inputText value="#{contactel.username}"/>
| <h:outputLabel value="Password :"/>
| <h:inputText value="#{contactel.password}"/>
| </h:panelGrid>
|
| <h:commandButton value="Save" action="#{ContactManager.createContact}"/>
|
| </h:form>
|
| </ui:define>
|
|
|
| </ui:composition>
|
| </body>
| </html>
|
and my bean :
| */
| @Stateful
| @Name("ContactManager")
| @Scope(CONVERSATION)
| public class ContactManager implements com.pingwy.web.front.ContactManagerLocal, Serializable{
|
|
|
| @In
| private EntityManager em;
|
| @DataModel("contacts")
| List<Contact> contacts;
|
| @In(required = false) @Out (required = false)
| Contact currentContact;
|
|
| @DataModelSelection("conts")
| @In (required = false)
| Contact contactel = new Contact();
|
| @DataModel("conts")
| private List<Contact> conts;
|
| @Factory("contacts")
| public String findContact(){
|
| Query query;
|
| query = em.createQuery("select c from Contact c where c.customerId=#{currentContact.customerId}");
|
| contacts = (List<Contact>) query.getResultList();
| return null;
|
|
| }
|
| public String updateContact(){
|
| em.merge(currentContact);
| return null;
|
| }
|
| public String removeContact (){
|
| System.out.println("contact bientot supprimé");
| em.remove(currentContact);
| return null;
| }
|
|
| @Begin(join = true)
| public String createContact(){
|
| conts.add(contactel);
|
| return "success";
|
| }
|
|
|
| public List<Contact> getConts() {
| return conts;
| }
|
| public void setConts(List<Contact> conts) {
| this.conts = conts;
|
| }
| public Contact getContactel() {
| return contactel;
| }
|
| public void setContactel(Contact contact) {
| this.contactel = contact;
| }
|
| @Remove @Destroy
| public void destroy(){
| }
| }
Thanks for your help .
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076616#4076616
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076616
18Â years, 8Â months
[JBoss jBPM] - Re: Decision -> select path
by masipu
update to problem:
If i don't use the join node (well, even if i do use this happens), both paths are still ran.
| <decision name="DecisionThing">
| <event type="node-enter">
| <action name="ResolveDecision" class="com.eventizer.actionhandlers.ResolveTransition">
| <nodeName>SomeName</nodeName>
| </action>
| </event>
| <transition name="0" to="Zero"></transition>
| <transition name="1" to="One"></transition>
| </decision>
| <state name="Zero">
| <event type="node-enter">
| <action name="DoSomething" class="com.eventizer.actionhandlers.Some">
| </action>
| </event>
| <transition name="" to="End process"></transition>
| </state>
| <state name="One">
| <event type="node-enter">
| <action name="DoSomethingElse" class="com.eventizer.actionhandlers.SomeElse">
| </action>
| </event>
| <transition name="" to="End process"></transition>
| </state>
|
So here, I want to either run Zero or One, not both.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076611#4076611
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076611
18Â years, 8Â months