[JBoss Cache] New message: "Inconsistent behaviour when fetching cached subclass entities?"
by Jimmy Borg
User development,
A new message was posted in the thread "Inconsistent behaviour when fetching cached subclass entities?":
http://community.jboss.org/message/527588#527588
Author : Jimmy Borg
Profile : http://community.jboss.org/people/jborg
Message:
--------------------------------------------------------------
Hi all,
The use of jboss-cache as hibernate second-level cache is leading to inconsistent behaviour when fetching cached subclass entities as opposed to fetching non-cached subclass entities.
*Scenario*
Consider a simple scenario having a parent entity:
> @Entity
> @Table(name = "tt_test")
> @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
> public abstract class ParentEntity implements Serializable {
>
> private static final long serialVersionUID = 5751958972675892020L;
>
> @Id
> private String id;
>
> protected ParentEntity() {
> super();
> }
>
> public ParentEntity(String id) {
> this.id = id;
> }
>
> public String getId() {
>
> return id;
> }
>
> }
and two subclass entities extending the above entity:
> @Entity
> public final class Subclass1 extends ParentEntity {
>
> private static final long serialVersionUID = -4329753920470094896L;
>
> protected Subclass1() {
> super();
> }
>
> public Subclass1(String id) {
> super(id);
> }
>
> @Override
> public String toString() {
>
> return "Subclass1 [ID={" + getId() + "}, Class={" + getClass() + "}]";
> }
> }
> @Entity
> public final class Subclass2 extends ParentEntity {
>
> private static final long serialVersionUID = -6102575763486357670L;
>
> /**
> * Default constructor (required for hibernation reasons)
> */
> protected Subclass2() {
> super();
> }
>
> public Subclass2(String id) {
> super(id);
> }
>
>
> @Override
> public String toString() {
>
> return "Subclass2 [ID={" + getId() + "}, Class={" + getClass() + "}]";
> }
> }
After persisting an instance of Subclass1 using:
> em.persist(new Subclass1("identifier1"));
Trying to fetch an instance of Subclass2 using:
> em.find(Subclass2.class, "identifier1");
will result in a +null+ return if the entity is not cached. This is the expected, correct behaviour.
However, when the entity with id +identifier1+ is cached, this will match and return an instance (of Subclass1) if the entity is cached. This appears to be both inconsistent behaviour, and a wrong result, as the entity with identifier +identifier1+ is of type Subclass1 not SubClass2, as requested in the call to em.find().
*Environment*
jboss-cache 1.4.1.SP13
hibernate 3.2.5
jboss 4.2.2
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527588#527588
16 years, 2 months
[EJB 3.0] New message: "howto setup jpa using oracle 10g unicode nvarchar2"
by Michael Glöckner
User development,
A new message was posted in the thread "howto setup jpa using oracle 10g unicode nvarchar2":
http://community.jboss.org/message/527586#527586
Author : Michael Glöckner
Profile : http://community.jboss.org/people/michael.gloeckner
Message:
--------------------------------------------------------------
Hello folks,
i like to setup jpa to use oracles nvarchar2 datatyp for string columns. Im using ejb3.0 and oracle 10.2.0.4.0
I already tried the suggestions made in http://community.jboss.org/message/489679#489679, but the only think which worked out was the following annotation added to the specific String variables.
@Column(columnDefinition="nvarchar2")
But this would force me to implement the source code in a oracle database depended way.
Is there any standard way to customize the datasource or the persistence.xml so the jpa framework is switching automatically to nvarchar2.
my persistence.xml looks like:
<persistence-unit name="MyPersistentUnit" transaction-type="JTA">
<jta-data-source>java:/MyDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
<property name="jboss.entity.manager.factory.jndi.name" value="java:/MyEjbTestEntityManagerFactory"/>
</properties>
</persistence-unit>
My ds.xml file looks like:
<xa-datasource>
<jndi-name>MyDS</jndi-name>
<track-connection-by-tx/>
<isSameRM-override-value>false</isSameRM-override-value>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:XE</xa-datasource-property>
<xa-datasource-property name="User">user</xa-datasource-property>
<xa-datasource-property name="Password">password</xa-datasource-property>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<no-tx-separate-pools/>
</xa-datasource>
Thanks in advanced,
Micha
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527586#527586
16 years, 2 months
[JBoss Messaging] New message: "Problem moving to 5.1.0 form 4.2.1"
by Dominic Hanlan
User development,
A new message was posted in the thread "Problem moving to 5.1.0 form 4.2.1":
http://community.jboss.org/message/527581#527581
Author : Dominic Hanlan
Profile : http://community.jboss.org/people/dhanlan
Message:
--------------------------------------------------------------
I Have been using JBoss 4.2.1 for about 18months with great success but have recently had the need to upgrade to 5.1.0. Everything went quite well untill I came to upgrade the messaging. I currently have a mixture of Topics and Queues defined. The Queues are used for MDB's and the Topics are used for a set of remote clients to subscribe to.
Having read various documents I got the server started and the destinations registered, the startup log is below.
07:58:37,531 INFO [QueueService] Queue[/queue/MyTest2Queue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,546 INFO [QueueService] Queue[/queue/reminderEmailQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,562 INFO [QueueService] Queue[/queue/recallEmailQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,578 INFO [QueueService] Queue[/queue/reminderSMSQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,593 INFO [QueueService] Queue[/queue/recallSMSQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,609 INFO [QueueService] Queue[/queue/ooPrintQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,625 INFO [TopicService] Topic[/topic/MyTest2Topic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,640 INFO [TopicService] Topic[/topic/UserTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,656 INFO [TopicService] Topic[/topic/PatientTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,671 INFO [TopicService] Topic[/topic/AppointmentTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,687 INFO [TopicService] Topic[/topic/TreatmentPlanTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,703 INFO [TopicService] Topic[/topic/AddTPToDiaryTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,734 INFO [TopicService] Topic[/topic/ChartTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,750 INFO [TopicService] Topic[/topic/RotaRuleTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,765 INFO [TopicService] Topic[/topic/MedNoteTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,781 INFO [TopicService] Topic[/topic/GenNoteTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,796 INFO [TopicService] Topic[/topic/InvoiceTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:58:37,812 INFO [TopicService] Topic[/topic/UpdatesTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
07:59:40,453 WARN [SimpleConnectionManager] A problem has been detected with the connection to remote client 5c4o1r1-ncsk79-g5yyf026-1
-g5yyf4xj-8, jmsClientID=f-rf5fyy5g-1-620fyy5g-97kscn-1r1o4c5. It is possible the client has exited without closing its connection(s) o
r the network has failed. All associated connection resources will be cleaned up.
The code which accesses the Topics is unchanged, save the JNDI name of the unclustered connection "ConnectionFactory". Now when ever a message is published, the code executes with out exception but no message are received by the client consumers.
The last line of the listing above shows what happens following exiting the client, indicating that a connection has been made.
The MDB are not receiving and messaged either, so there is a general failure in the messaging.
An example of the destination-service.xml for one of the Topics is below,
<mbean code="org.jboss.jms.server.destination.TopicService" name="jboss.messaging.destination:service=Topic,name=MyTest2Topic"
xmbean-dd="xmdesc/Topic-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
</mbean>
Any hints on how I would go about solving this one would be great, I have turned on the logging for messaging to DEBUG level but I get nothing when a message is sent, just during startup.
Thanks in advance
/Dominic
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527581#527581
16 years, 2 months
[Performance Tuning] New message: "Variation in Max Heap size"
by Rohit Macherla
User development,
A new message was posted in the thread "Variation in Max Heap size":
http://community.jboss.org/message/527579#527579
Author : Rohit Macherla
Profile : http://community.jboss.org/people/rohit.macherla
Message:
--------------------------------------------------------------
Hi ,
I am using JBoss 4.2.3.GA server on a HP UX machine. Recently, our organization planned to buy a tool for performance monitoring of the enterprise applications. We have received reports that the maximum value of the heap is varying at times. As a direct result, I can see the CPU utilization (4 core, 3GHz machine) going up to 70% from a 30%. The funny thing is : actual heap utilization is almost constant (at 750MB)
I have attached an image of the heap variation. (In the picture, the green line represents the max heap while the red one marks the current utilization. We can notice that about the same time, the CPU utilization also increased.)
In the run.conf file, we have the following JVM parameters :
> JAVA_OPTS="-server -Xms2048m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=256m
> -XX:NewSize=640m -X:MaxNewSize=640m -XX:SurvivorRatio=16 -Dsun.rmi.dgc.client.gcInterval=3600000
> -Dsun.rmi.dgc.server.gcInterval=3600000 -XX:+UseParallelGC
> -XX:ParallelGCThreads=4"
As we can see, the whole point of making the min and max heap values to be same (2GB) was to avoid the dynamic heap memory allocation by the OS. I am unable to understand why the max heap is varying even though the actual utilization remains the same.
Please let me know if I miss something.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527579#527579
16 years, 2 months
JBoss ON error with Oracle plugin
by Manuel Fernández Panzuela
Hello,
I'm trying to monitor my Oracle application. The agent is working perfectly,
but my Oracle application is not monitoring correctly.
I've added the plugin from Oracle (RHQ-oracle-plugin-1.2.0.GA.jar) which is
need it to monitor this application, but when it's run for the first time I
get an error, the error message is:
An unexpected error occurred in the Agent. Cause:
java.lang.Exception:Discovery component invocation failed. ->
org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException:Unable
to connect to Oracle ->
org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException:Specified
JDBC driver class (oracle.jdbc.driver.OracleDriver) not found.
i believe the error says "can not load the driver" because ojdbc is not into
plugin-oracle-plugin-1.2.0.GA.jar. Looking for information I came to this
link:
http://jopr.org/display/RHQ/Advanced+Build+Notes #
AdvancedBuildNotes-BuildingWithOracle
I've added the library ojdbc14.jar within the plugin, as explained in the
link, creating a lib in the root directory of the plugin and entering into
this ojdbc14.jar driver (downloaded from Oracle's website).
I replaced the plugin and restarted the agent, to reload, but I keep getting
the same error.
The plugin is updated into server's too
Thank you in advance.
16 years, 2 months
[jBPM] New message: "Update properties or fields in custom node"
by Flavio N.
User development,
A new message was posted in the thread "Update properties or fields in custom node":
http://community.jboss.org/message/527574#527574
Author : Flavio N.
Profile : http://community.jboss.org/people/VegaMilano
Message:
--------------------------------------------------------------
I have a problem with custom nodes.
I have a custom node which call execute method of MyClass (MyClass extends ActivityBehaviour).
I need to set a property of the class to use inside the method:
<custom class="sample.MyClass" name="MyClassNode">
<property name="myObject">
<object expr="#{my-object}" />
</property>
</custom>
It appers the property is set correctly to my-object variable only the first time I run the process; following times the old (first) object is used; I test it and it never call again the property setter.
No difference using field instead of property: only the first time the value is set.
Is there any method to tell to the process to set field or property values EACH TIME the node is executed?
Obviously I can refer to the variable inside the method, but I need to call my class in different point of the process using different value of myObject and I can't have the name of the variabile hard-coded.
Thanx in advance
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527574#527574
16 years, 2 months