[JNDI/Naming/Network] - Issue with JBoss JNDI Data Source Autocommit Feature
by nnanda
Hi,
In my current project, we are using JBoss 5 GA application server. For database interactions, we are using JNDI data source configured in JBoss AS. I am trying to configure the Autocommit to "FALSE", however, it is not happening. Even if I have put the required configuration in my oracle-ds.xml file, the autocommit seems to be in TRUE state and all my inserts are commited automatically in the DB. Please see below my configuration of oracle-ds.xml file.
| <?xml version="1.0" encoding="UTF-8"?>
|
| <datasources>
| <local-tx-datasource>
| <jndi-name>MyDS</jndi-name>
| <use-java-context>false</use-java-context>
|
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
| <connection-url>MY_URL</connection-url>
| <user-name>USER</user-name>
| <password>PASSWORD</password>
|
| <!-- The minimum connections in a pool/sub-pool -->
| <min-pool-size>5</min-pool-size>
|
| <!-- The maximum connections in a pool/sub-pool -->
| <max-pool-size>10</max-pool-size>
|
| <!-- The time before an unused connection is destroyed -->
| <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
| <idle-timeout-minutes>0</idle-timeout-minutes>
|
| <!-- ORACLE benefits from prepared statement caching -->
| <prepared-statement-cache-size>32</prepared-statement-cache-size>
|
| <!-- Connection Properties -->
| <connection-property name="auto-commit">false</connection-property>
|
| </local-tx-datasource>
| </datasources>
|
This seems to be very strange. Is this a BUG in Jboss? Or I am missing any configuration? Please HELP.
Thanks,
Niranjan
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232012#4232012
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232012
17 years, 2 months
[Beginners Corner] - Re: Multiple schema access
by ander.gborges
Hi Peter,
Thanks for your response!
My use case: I am developing a app where little companies will register to use for some days for free. After that period, these companies will have to pay or leave the aplication. With separeted data bases, it is possible to just erase the unused database without affect any other, is possible to make daily backups and restore only the database of a specific company without any kind of danger of handle another's companies DBs.
The app is already developed today in the model "B" you wrote, but actually we have only 5 clients and we are having some trouble when handle data. I am talking about more than 2000 companies, so we thought that separated databases would be the solution for that.
about the "A" option you wrote: I did not understand why implement Driver or Connection interface, because when using pure Hibernate I found out that is pretty easy to create Session objects that points to diferents databases, so I thought that to do it in JBoss would be as easy.
I was planning to use the security declaration to get not only the userName and password but also the database name, and them, when the user call any action, I could get the database Name through the session context and then inject the correct entityManager to the sessionBean.
Well, now I am seriously thinking about use any kind of interceptor to get the queries String and change it to point to the user database (databasename.table for example), or even to give up the EJB model and handle the transactions for myself.
Sorry if I did not made myself clear, I am not a native english speaker.
Thanks!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232009#4232009
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232009
17 years, 2 months
[JNDI/Naming/Network] - Re: Slow JMS destination lookup
by PeterJ
That was too vague and confusing.
What do you mean by "response times are slow consistently after we increase the load" That is exactly what I would suspect would happen - the higher the load the slower the response times. And response times for what - the JNDI lookup only or for sending the messages?
It is especially confusing when you then say "And only lookup that slows down is looking up queue destination". Are you saying that the response time for sending a message, or the whole processing of a message, is acceptable? Are you saying that only one particular queue has this issue? Are you saying that looking up a topic destination does not have this issue? Are you saying that the response time for looking up the connection factory is acceptable but the response time for looking up the queue is not?
Please be very specific and supply numbers, including information about the load.
And it still could be GC.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232007#4232007
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232007
17 years, 2 months
[JBoss Messaging] - Re: Multiple clients and message types - selectors?
by cpslo1999
Sure (and thanks so much for your help!).
I have what amounts to a store-and-forward system (let's call it the SAF for this discussion). It feeds multiple client systems. The SAF receives a number of files from different, external systems, which it stores and makes available via HTTP. The clients are each interested in some subset of these files (the subsets can and will overlap).
I am trying to design a communications mechanism that will allow the SAF to send asynchronous notifications to the clients when interesting files arrive. In most cases this will be done as the files arrive (perfect for a topic with client-side selectors), however, I also need to build in the ability to target one particular client from the SAF and re-play the notifications. Say I add a new client system, I need to be able to tell the SAF to send notifications to that new client for files that were received before the client was added (back-filling). Also, if a processing algorithm changes on one of the clients, I may need to send notifications for files that the client had processed once before (re-sending).
It is really this notion of targeting a single client that has me befuddled. Adding a new queue for each client administratively seems like a tight coupling and a fair amount of manual configuration overhead. Using a pure topic, I can't figure out how to provide this secondary feature of targeted playback.
Did that clarify the situation enough?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4231961#4231961
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4231961
17 years, 2 months
[Beginners Corner] - Re: Multiple schema access
by PeterJ
There is no such capability build into EJB, nor is there an option in JBoss AS to support this. I would be interested to hear what your use case is (that is, why you think you need a separate database per user).
I can think of two ways to implement this.
a) Using JDBC: write your own JDBC layer (you will probably have to implement only the Driver interface, but perhaps also the Connection interface) that sits between JBoss AS and the real JDBC driver. When a connection is made, have your code look up the user for that connection and use a database call (such as 'use somedb' in MySQL) to switch the database. [There have been other posts in the forums where people wanted the connection to use the user's account name as the database login id, and if I recall correctly someone posted that the Oracle JDBC driver had some kind of option to enable this. You could search for those posts, they might give you some other clues as to what is possible.]
b) Use one database for everyone and add a userId field to each of the tables. Then change all of the queries to add "and userId=xxx" to the where clause. This way each user should see only his or her data.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4231944#4231944
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4231944
17 years, 2 months
[JCA/JBoss] - Problem with RA & inbound transaction -> MDB -> CMPs
by matterbury
I have an EJB of 5 entity beans and 5 corresponding session beans. The only methods are to create an instance of an entity (it is a toy test case). All 5 entities must be created together due to FK constraints (each is created by invoking the 'create' method on the corresponding session bean). It works fine when invoked in a UserTransaction from a remtoe Java client program.
I also have an RA and MDB that implement JCA inbound transactions. In response to requests, the RA creates an XID and creates an execution context in which the MDB is invoked, which invokes the EJBs methods.
At the end, the RA tries to end (+ prepare + commit) the transaction, but this is failing because arjuna tries to update one of the created records but cannot find it, despite it logging earlier that it INSERTed it and that it found it using SELECT (I hand check each FK constraint in the SB's create method).
AFAIK this means that the end is being executed in the wrong thread/context as otherwise it should find it (again).
So, my questions are: is there any other reason the update could fail? how might I track down what's going wrong (I have turned on arjuna's DEBUG but it doesn't give enough detail for this)?
FWIW, the actual exception is:
| 2009-05-19 09:50:42,557 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.AddressEB] Executing SQL: UPDATE ADDRESS SET CITY=?, STATE=?, SUBURB_CODE=?, COUNTRY=?, TELEPHONE=?, EMAIL=?, cname=? WHERE LINE1=?
| 2009-05-19 09:50:42,561 DEBUG [com.arjuna.ats.jta.logging.logger] BaseTransaction.getStatus
| 2009-05-19 09:50:52,014 DEBUG [com.arjuna.ats.jta.logging.logger] TransactionImple.setRollbackOnly
| 2009-05-19 09:50:52,014 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@1971f66
| javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=875 Main St
| at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:169)
| at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:666)
| at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:428)
| :
| :
| :
|
TIA!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4231925#4231925
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4231925
17 years, 2 months