[JCA/JBoss] - JBoss changing database connection on bean, thus loosing tem
by sbglasius
Hi,
First: Hope this is the right forum to ask this question.
We have this older system that we have ported from SilverStream to JBoss, and almost everything is working fine. One problem though.
Background on the system. We have a thich java client, the appserver and a Sybase 12.5.x database server. We do not use transactions (eg. we use a non-tx datasource) - and we run with autocommit on (for historical reasons).
We have an app, which accesses a tempdb on Sybase through a statefull sessionbean. The client must do some client calculations, and return to the sessionbean several times during an iteration. In the session bean we create a tempdb, which on sybase will disapear again, when the connection closes (eg. is returned to the pool). How do we make sure, that this database connection obtained when creating the tempdb is retained during the sessionbean lifetime?
This is our database connector:
<datasources>
| <no-tx-datasource>
| <jndi-name>jdbc/DISY</jndi-name>
| <connection-url>jdbc:sybase:Tds:host:4002/database?AUTOCOMMIT=TRUE</connection-url>
| <driver-class>com.sybase.jdbc2.jdbc.SybDataSource</driver-class>
| <user-name>user</user-name>
| <password>pwd</password>
| <min-pool-size>5</min-pool-size>
| <max-pool-size>100</max-pool-size>
| <idle-timeout-minutes>30</idle-timeout-minutes>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
| <new-connection-sql>select 1 where 2=1</new-connection-sql>
| <check-valid-connection-sql>select 1 where 2=1</check-valid-connection-sql>
| <metadata>
| <type-mapping>Sybase</type-mapping>
| </metadata>
| </no-tx-datasource>
| </datasources>
|
Any suggestions in what direction to search will be greatly appreciated!
Best regards,
Søren Berg Glasius
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970688#3970688
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970688
19 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - Version checks against non-existent objects
by areceeyou
Hi everybody,
please forgive me, if I'm asking this question for the 10201th time, but I'm really new to this stuff.
I've got some Entity-Beans, which are transferred to a couple of Swing clients. These beans are then existing as POJO's unmanaged on the clients. If one of these clients is removing an entity, a session bean will remove it on the server. The other clients still have the correspondending POJO. If another client will operate on this POJO, e.g. rename its caption, and is then updating it via a session bean (entityManager.merge()), a new entity will be created (standard procedure of merge()).
It seems like there are no version checks against non-existent objects, I was expecting something like an exception: 'Now way, dude, entity was removed before'.
Am I missing something, or have I to do a check manually (i.g. with a special boolean 'removed' column, which has to be checked every time - what a pain)?
Any help is highly appreciated. Thanks in advance.
Rene
P.s.: I'm using optimistic locking with @version and @Id @GeneratedValue.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970687#3970687
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970687
19 years, 7 months
[Messaging, JMS & JBossMQ] - MailListener MDB (EJB3)
by burakbayramli
I am trying to EJB3'ify the MailListener MDB given by Scott Start based on the Wiki item below
http://wiki.jboss.org/wiki/Wiki.jsp?page=InboundJavaMail
I have deployed the code below to JBoss 4.0.4.GA. The MDB comes up, but it doesn't connect to the mailserver specified.
| @MessageDriven(activationConfig =
| {
| @ActivationConfigProperty(propertyName="messagingType",
| propertyValue="org.jboss.resource.adapter.mail.inflow.MailListener"),
| @ActivationConfigProperty(propertyName="mailServer",
| propertyValue="pop.gmail.com"),
| @ActivationConfigProperty(propertyName="mailFolder",
| propertyValue="Inbox"),
| @ActivationConfigProperty(propertyName="storeProtocol",
| propertyValue="imap"),
| @ActivationConfigProperty(propertyName="userName",
| propertyValue="****"),
| @ActivationConfigProperty(propertyName="password",
| propertyValue="***")
|
| })
| public class MailReaderMdb implements MailListener {
|
| @Resource MessageDrivenContext mdc;
|
| public void onMessage(javax.mail.Message message) {
| System.out.println(""+message);
| }
|
| }
Also, mail-ra.rar was not part of 4.0.4.GA, which I copied from 4.0.1.zip installation. Not sure if this was the right thing to do.
I was not sure what to do with stuff inside jboss.xml config either, with annotation style configuration are they still needed?
I also get the message below;
11:53:55,789 WARN [MDB] No message-driven-destination given; using; guessing ty
| pe
| 11:53:55,799 WARN [MDB] Could not determine destination type, defaults to: java
| x.jms.Topic
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970683#3970683
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970683
19 years, 7 months