[JBoss Cache: Core Edition] - Re: JPA/Hibernate JBC usage
by bstansberry@jboss.com
How is TX1 reading the entity? Via an EntityManager.find() or are you using a query that amounts to the same thing?
The logging like this:
| 2009-04-01 13:51:50,515 DEBUG [org.jboss.cache.invocation.CacheInvocationDelegate] (WorkerThread#0[127.0.0.1:4967]) putForExternalRead() called with Fqn /persistence.unit:unitName=SPECjAppServer.ear/corp.jar#corp-persistence/org/spec/jappserver/corp/customerinventoryent/ejb/CCustomerInventory/ENTITY/org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56510 and this node already exists. This method is hence a no op.
tells me Hibernate is trying to cache an entity that is already cached. It would only do that if it didn't try to read the cache in the first place. So I'm trying to understand why it didn't read the cache. (The non-read of the cache by TX1 is why the TX2 write doesn't block on a read lock.)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222750#4222750
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222750
15 years, 9 months
[JBoss Cache: Core Edition] - Re: JPA/Hibernate JBC usage
by zeravlai
These are my checkings in order to be sure the entity is in the cache:
- Before T1 starts, I check the cache in the jmx console and the entity is there.
- After T1 and T2 finish their execution, I check both the CacheMgmtInterceptor statistics (2 hits, one find per transaction), which looks fine and also the traces. Below you can see them, from before T1 reads to after it is done. T1 reads a Customer entity which has some CustomerInventory entities (collection). I only see the select to retrieve the collection but not the entity itself.
2009-04-01 13:51:50,468 INFO [STDOUT] (WorkerThread#0[127.0.0.1:4967]) TX: t1 starts
| 2009-04-01 13:51:50,468 INFO [STDOUT] (WorkerThread#0[127.0.0.1:4967]) TX: t1 reading Customer 1137 from Cache
| 2009-04-01 13:51:50,468 DEBUG [org.hibernate.impl.SessionImpl] (WorkerThread#0[127.0.0.1:4967]) opened session at timestamp: 12385867104
| 2009-04-01 13:51:50,468 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] (WorkerThread#0[127.0.0.1:4967]) Looking for a JTA transaction to join
| 2009-04-01 13:51:50,468 DEBUG [org.hibernate.jdbc.JDBCContext] (WorkerThread#0[127.0.0.1:4967]) successfully registered Synchronization
| 2009-04-01 13:51:50,468 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] (WorkerThread#0[127.0.0.1:4967]) Looking for a JTA transaction to join
| 2009-04-01 13:51:50,468 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] (WorkerThread#0[127.0.0.1:4967]) Transaction already joined
| 2009-04-01 13:51:50,484 DEBUG [org.hibernate.engine.StatefulPersistenceContext] (WorkerThread#0[127.0.0.1:4967]) initializing non-lazy collections
| 2009-04-01 13:51:50,484 DEBUG [org.hibernate.loader.Loader] (WorkerThread#0[127.0.0.1:4967]) loading collection: [org.spec.jappserver.corp.customerent.ejb.CCustomer.customerInventory#1137]
| 2009-04-01 13:51:50,484 DEBUG [org.hibernate.jdbc.AbstractBatcher] (WorkerThread#0[127.0.0.1:4967]) about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
| 2009-04-01 13:51:50,484 DEBUG [org.hibernate.jdbc.ConnectionManager] (WorkerThread#0[127.0.0.1:4967]) opening JDBC connection
| 2009-04-01 13:51:50,484 DEBUG [org.hibernate.SQL] (WorkerThread#0[127.0.0.1:4967]) select customerin0_.ci_customerid as ci5_1_, customerin0_.ci_id as ci1_1_, customerin0_.ci_id as ci1_4_0_, customerin0_.ci_itemid as ci2_4_0_, customerin0_.ci_quantity as ci3_4_0_, customerin0_.ci_value as ci4_4_0_, customerin0_.ci_customerid as ci5_4_0_ from c_customerinventory customerin0_ where customerin0_.ci_customerid=?
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.jdbc.AbstractBatcher] (WorkerThread#0[127.0.0.1:4967]) about to open ResultSet (open ResultSets: 0, globally: 0)
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.loader.Loader] (WorkerThread#0[127.0.0.1:4967]) result set contains (possibly empty) collection: [org.spec.jappserver.corp.customerent.ejb.CCustomer.customerInventory#1137]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.loader.Loader] (WorkerThread#0[127.0.0.1:4967]) result row: EntityKey[org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56510]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.loader.Loader] (WorkerThread#0[127.0.0.1:4967]) found row of collection: [org.spec.jappserver.corp.customerent.ejb.CCustomer.customerInventory#1137]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.loader.Loader] (WorkerThread#0[127.0.0.1:4967]) result row: EntityKey[org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56525]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.loader.Loader] (WorkerThread#0[127.0.0.1:4967]) found row of collection: [org.spec.jappserver.corp.customerent.ejb.CCustomer.customerInventory#1137]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.jdbc.AbstractBatcher] (WorkerThread#0[127.0.0.1:4967]) about to close ResultSet (open ResultSets: 1, globally: 1)
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.jdbc.AbstractBatcher] (WorkerThread#0[127.0.0.1:4967]) about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.jdbc.ConnectionManager] (WorkerThread#0[127.0.0.1:4967]) aggressively releasing JDBC connection
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.jdbc.ConnectionManager] (WorkerThread#0[127.0.0.1:4967]) releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.engine.TwoPhaseLoad] (WorkerThread#0[127.0.0.1:4967]) resolving associations for [org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56510]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.engine.TwoPhaseLoad] (WorkerThread#0[127.0.0.1:4967]) adding entity to second-level cache: [org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56510]
| 2009-04-01 13:51:50,515 DEBUG [org.jboss.cache.invocation.CacheInvocationDelegate] (WorkerThread#0[127.0.0.1:4967]) putForExternalRead() called with Fqn /persistence.unit:unitName=SPECjAppServer.ear/corp.jar#corp-persistence/org/spec/jappserver/corp/customerinventoryent/ejb/CCustomerInventory/ENTITY/org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56510 and this node already exists. This method is hence a no op.
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.engine.TwoPhaseLoad] (WorkerThread#0[127.0.0.1:4967]) done materializing entity [org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56510]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.engine.TwoPhaseLoad] (WorkerThread#0[127.0.0.1:4967]) resolving associations for [org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56525]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.engine.TwoPhaseLoad] (WorkerThread#0[127.0.0.1:4967]) adding entity to second-level cache: [org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56525]
| 2009-04-01 13:51:50,515 DEBUG [org.jboss.cache.invocation.CacheInvocationDelegate] (WorkerThread#0[127.0.0.1:4967]) putForExternalRead() called with Fqn /persistence.unit:unitName=SPECjAppServer.ear/corp.jar#corp-persistence/org/spec/jappserver/corp/customerinventoryent/ejb/CCustomerInventory/ENTITY/org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56525 and this node already exists. This method is hence a no op.
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.engine.TwoPhaseLoad] (WorkerThread#0[127.0.0.1:4967]) done materializing entity [org.spec.jappserver.corp.customerinventoryent.ejb.CCustomerInventory#56525]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.engine.loading.CollectionLoadContext] (WorkerThread#0[127.0.0.1:4967]) 1 collections were found in result set for role: org.spec.jappserver.corp.customerent.ejb.CCustomer.customerInventory
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.engine.loading.CollectionLoadContext] (WorkerThread#0[127.0.0.1:4967]) collection fully initialized: [org.spec.jappserver.corp.customerent.ejb.CCustomer.customerInventory#1137]
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.engine.loading.CollectionLoadContext] (WorkerThread#0[127.0.0.1:4967]) 1 collections initialized for role: org.spec.jappserver.corp.customerent.ejb.CCustomer.customerInventory
| 2009-04-01 13:51:50,515 DEBUG [org.hibernate.loader.Loader] (WorkerThread#0[127.0.0.1:4967]) done loading collection
| 2009-04-01 13:51:50,515 INFO [STDOUT] (WorkerThread#0[127.0.0.1:4967]) TX: t1 doing other things ...
What you think?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222744#4222744
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222744
15 years, 9 months
[JBoss jBPM] - Re: JBPM Data Base - Table's column meaning
by zuipli
An example: in this moment I added to my user Stefano the membership in groups hr, admin and user, the same groups of the admin user, and to do this I used the jbpm-console.
Why using Stefano I'm not able to login in the jbpm-console?
In the jbpm data base this are the values:
select t1.id_, t1.name_, t1.password_,
t3.name_ as group_name, t3.type_ as group_type
from jbpm_id_user t1,
jbpm_id_membership t2,
jbpm_id_group t3
where t1.id_ = t2.user_ and
t2.group_ = t3.id_ and
t1.name_ in ('admin', 'stefano');
order by t1.id_, t3.name_;
id_name_password_group_namegroup_type
3adminadminadminsecurity-role
3adminadminhrorganisation
3adminadminusersecurity-role
104stefanostefanoadminsecurity-role
104stefanostefanohrorganisation
104stefanostefanousersecurity-role
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222727#4222727
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222727
15 years, 9 months
[JBossWS] - WebFault targetNamespace and document/literal
by bartvh
It looks like there is a problem with the namespace for web faults when this is not the same as the namespace of the service. The type definition of the web faults has the correct namespace, but the reference to the type from the messsage elements uses the name space of the service instead.
For example:package zzz.ws.flt;
|
| import javax.xml.bind.annotation.XmlType;
| import javax.xml.ws.WebFault;
|
| @WebFault(targetNamespace="zzz.ws.flt")
| @XmlType(namespace="zzz.ws.flt")
| public class ZZZException extends Exception {
| private String info;
|
| public ZZZException(String info) {
| this.setInfo(info);
| }
|
| public void setInfo(String info) {
| this.info = info;
| }
|
| public String getInfo() {
| return info;
| }
| }
andpackage zzz.ws.srv.impl;
|
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.jws.soap.SOAPBinding.ParameterStyle;
| import javax.jws.soap.SOAPBinding.Style;
| import javax.jws.soap.SOAPBinding.Use;
|
| import zzz.ws.flt.ZZZException;
| import zzz.ws.srv.ZZZService;
|
| @Stateless
| @Remote(ZZZService.class)
| @WebService(targetNamespace="zzz.ws.srv", name="ZZZService")
| @SOAPBinding(style=Style.DOCUMENT, use=Use.LITERAL, parameterStyle=ParameterStyle.WRAPPED)
| public class ZZZServiceImpl implements ZZZService {
|
| @WebMethod
| public String echo(String input) throws ZZZException {
| return input;
| }
| }
generates
<?xml version="1.0" encoding="UTF-8"?>
| <definitions name="ZZZServiceImplService" targetNamespace="zzz.ws.srv" xmlns:tns="zzz.ws.srv" xmlns:ns1="zzz.ws.flt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
| <types>
| <xs:schema targetNamespace="zzz.ws.srv" version="1.0" xmlns:tns="zzz.ws.srv" xmlns:xs="http://www.w3.org/2001/XMLSchema">
| <xs:element name="echo" type="tns:echo"/>
| <xs:element name="echoResponse" type="tns:echoResponse"/>
| <xs:complexType name="echo">
| <xs:sequence>
| <xs:element minOccurs="0" name="arg0" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name="echoResponse">
| <xs:sequence>
| <xs:element minOccurs="0" name="return" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| <xs:schema targetNamespace="zzz.ws.flt" version="1.0" xmlns:tns="zzz.ws.flt" xmlns:xs="http://www.w3.org/2001/XMLSchema">
| <xs:element name="ZZZException" type="tns:ZZZException"/>
| <xs:complexType name="ZZZException">
| <xs:sequence>
| <xs:element minOccurs="0" name="info" type="xs:string"/>
| <xs:element minOccurs="0" name="message" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </types>
| <message name="ZZZService_echo">
| <part name="echo" element="tns:echo">
| </part>
| </message>
| <message name="ZZZException">
| <part name="ZZZException" element="tns:ZZZException">
| </part>
| </message>
| <message name="ZZZService_echoResponse">
| <part name="echoResponse" element="tns:echoResponse">
| </part>
| </message>
| <portType name="ZZZService">
| <operation name="echo" parameterOrder="echo">
| <input message="tns:ZZZService_echo">
| </input>
| <output message="tns:ZZZService_echoResponse">
| </output>
| <fault name="ZZZException" message="tns:ZZZException">
| </fault>
| </operation>
| </portType>
| <binding name="ZZZServiceBinding" type="tns:ZZZService">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
| <operation name="echo">
| <soap:operation soapAction=""/>
| <input>
| <soap:body use="literal"/>
| </input>
| <output>
| <soap:body use="literal"/>
| </output>
| <fault name="ZZZException">
| <soap:fault name="ZZZException" use="literal"/>
| </fault>
| </operation>
| </binding>
| <service name="ZZZServiceImplService">
| <port name="ZZZServicePort" binding="tns:ZZZServiceBinding">
| <soap:address location="http://jbossws.undefined.host:8080/zzz-zzzservice-ejb/ZZZServiceImpl"/>
| </port>
| </service>
| </definitions>
Notice the element="tns:ZZZException" in the output.
This is running jbossws-native-3.1.0.GA on jboss-4.2.3.GA.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222724#4222724
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222724
15 years, 9 months