[JCA/JBoss] - datasource from log4j appender
by fuzzy333
I've got an issue getting connections from a data source from a log4j appender.
The appender is configured to use the same data source as the application, and when code from a @PreDestroy EJB method writes to log4j, this error occurs in the appender.
| org.jboss.util.NestedSQLException:
| Transaction is not active: tx=TransactionImple < ac, BasicAction: -53efa2b4:11e1:49f5f5da:70 status: ActionStatus.COMMITTED >;
| - nested throwable: (javax.resource.ResourceException:
| Transaction is not active: tx=TransactionImple < ac, BasicAction: -53efa2b4:11e1:49f5f5da:70 status: ActionStatus.COMMITTED >)
| at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
| at ca.company.foo.log.DSConnectionHandler.getConnection(DSConnectionHandler.java:34)
| at org.apache.log4j.jdbcplus.JDBCLogger.prepareConnection(JDBCLogger.java:489)
| at org.apache.log4j.jdbcplus.JDBCLogger.append(JDBCLogger.java:555)
| at org.apache.log4j.jdbcplus.JDBCAppender.flush_buffer(JDBCAppender.java:887)
| at org.apache.log4j.jdbcplus.JDBCAppender.append(JDBCAppender.java:867)
| [snip]
|
I'm expecting to get a connection back from the data source that I can use in autocommit mode (write the log to the database and return the connection to the pool)
Here is the data source definition, nothing fancy
| <local-tx-datasource>
| <jndi-name>scnDatasource</jndi-name>
| <connection-url>jdbc:oracle:thin:@cps-test-1:1521:CPSDEV</connection-url>
| <driver-class>oracle.jdbc.OracleDriver</driver-class>
| <user-name>test</user-name>
| <password>test</password>
| </local-tx-datasource>
|
Creating a copy of the data source, changing "local-tx-datasource" to "no-tx-datasource" makes the problem go away, but I'd rather use the same data source. I guess there's something I'm missing or not understanding. Are data sources supposed to be shareable like this?
I'm using jboss-5.0.0.GA + jboss-seam-2.1.1.GA
Cheers!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227060#4227060
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227060
15 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - Using a SessionFactory with multiple connection contexts
by offby1
I would like to describe a use case for Hibernate, and get some feedback as to
whether it's possible as described, or whether I need to consider a different
approach.
Our application operates in multiple instances of the same database schema for
purposes of isolation, as well as a second schema that is global to all
participators. A single user is granted access to parts of all of these
schemas to perform operations that must take effect on all of them.
So, we have this arrangement:
SchemaA: r/w accessible to UserA, r/o accessible to UsersB[0..N]
SchemaB[0..N]: r/w accessible to UsersB[0..N]
UserC with access to A, B[0..N]
This arrangement is a business requirement, so I can't really change it.
Additionally, the names of the UserB class users are not known at configuration
or compilation time, they are provided at runtime by data, and new ones may be
created at any time without an application restart; the schema is instantiated
by an external process.
So, we have two scenarios:
1. Logged in as UserB[m]. Accesses to tables within SchemaB do not need schema
qualification, acceses to SchemaA require qualification as UserA.TABLE.
2. Logged in as UserC. All accesses require schema name qualification,
and the specific instance of UserB that must be used is determined from
current state.
Is there any way whatsoever to configure a single SessionFactory to do this?
I know that I can create a separate SessionFactory for each UserB and for
UserC, but that makes for a very expensive delay the first time a
SessionFactory is initialized. The thing here is that each instance of SchemaB
is identical. It seems like a waste to configure a separate SessionFactory
for each of them.
Any advice on how to do this would be welcome. If it makes a difference, this
is a J2SE application.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227055#4227055
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227055
15 years, 7 months
[Clustering/JBoss] - Shared objects in cluster
by bentins
I have a running JBoss 4.2.3.GA cluster running. My application, not originally designed for a cluster, has some Singleton objects that hold in memory code tables. This tables rarely change, but when they do, I need to update the whole cluster. Since moving to the cluster I face the problem that when such a change occurs it only occurs on the node which it was done on and the other nodes are not aware.
I need to redesign these objects. It seems the best solution is to keep these code tables in a shared cache, i.e. the treecahce used by the cluster.
1. Can some one direct me to a code example on how this is done in a cluster.
2. Does anyone think I should use a different solution for this problem?
Thnx
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227053#4227053
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227053
15 years, 7 months
[Installation, Configuration & DEPLOYMENT] Migration of a Tomcat app to JBoss 4.x
by Michael Obster
Hi,
can anyone tell me a good strategy to migrate an existing struts 1
application from a tomcat 5.5 to a jboss 4.x release?
the problem i have, is a specialty i have in my application. the
war-file is currently deployed somewhere in the filesystem, but i use a
applicationName.xml file in conf/Catalina/localhost to deploy the
application.
the problem is, the file contains some configuration options like the
datasource, filepath to the log4j config and so on. so simply dropping
the war file into deploy of JBoss doesn't work.
is it possible to use such an xml file also in JBoss? you i have to
configure this (means where i have to drop the war- and the xml-file,
what things i have to pay attention, ...)?
or do i have to change the configuration and inject them over some extra
property-files?
kind regards,
michael obster
15 years, 7 months
[Performance Tuning] - Re: Physical vs Virtual Memory
by PeterJ
It will use more than that. I have just been running some perf tests with a 1GB heap and my JVMs memory usage was over 1GB. But that was not on a VM. Hmm, I have a Server 2008 VM, perhaps I'll fire it up and run my code there - I'll let you know my results.
I see the term "JavaService". Are you certain that you changed the JVM parameters properly? JavaService (if it is http://wrapper.tanukisoftware.org/) uses registry entries to specify the heap size. Also, it has been a while since I used JavaService and I cannot remember if it forks a separate Java process or if it loads the JVM DLL directly. A tool such as Process Explorer from sysinternals should shed light on that.
Also, if you set the pagefile to 0, make sure you allocate enough memory to the virtual machine. Without the JVM running you should have at least 1.5GB free memory. You might have to allocate 2.5GB or 3GB to the virtual machine.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227047#4227047
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227047
15 years, 7 months
[JBoss jBPM] - Strategies on concurrent execution of FORK-JOIN execution pa
by ckadam
Hi All,
I am using jbpm version 3.2.6.sp1. (recently upgraded from 3.1.4). One of the business scenarios I am trying to support is, to be able to run multiple branches in FORK-JOIN execution paths concurrently. I have searched this user forum as well as wiki for possible ways of implementing this scenario.
Here is my understanding, and I was hoping to validate it from some of you, who may have implemented something similar:
1. Use of ASYNC=true on node, which will queue execution of Node-Actions using JMS. Default fork handler will create child tokens for each possible transition in the fork definition and will be able to signal them right away (since each child token signal call would return right away after queuing the action).
2. I could write custom fork handler Or some client process executor, which creates child token for each transition and submits token.signal() calls in separate threads. (i.e. client would manage the threads for each execution paths). However, I am afraid, I might run into some hibernate concurrency issues (when updating process instance).
Does anyone have better suggestions ? or experience with such implementations. Any pointers / suggestions are very much appreciated.
Thanks !
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227045#4227045
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227045
15 years, 7 months