Peter, here is the pseudo-snippet that should answer your questions about how 
the things are right now:

@Service(objectName = "MyServer:service=MyManagement")
@Management(MyManagement.class)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class MyManagementBean implements MyManagement {
        @Resource(mappedName = "java:/MY_DATA_SOURCE")
        private DataSource dataSource;
        
        private LegacyClass legacyObject;
        
        public void doSomething() {
                Connection dbConnection = dataSource.getConnection();
                if(this.legacyObject == null || dbConnection.isClosed()) {
                        this.legacyObject = new LegacyClass(dbConnection, ...);
                }
                legacyObject.legacyDoSomething();
                
                // ...
                
                // I don't close the connection
        }
        
        // ...
}

I get the message in question after doSomething exits. If I understood you 
correctly, this is not a good way, since I am using a DataSource, correct? I.e. 
the only option is not using DataSources, but JDBC directly. JBoss will always 
forcibly close the connection. Is there some parameter that I can tweak this 
with?

If this is not possible, is there a simple way to get the parameters of that 
DataSource, so I can use them to make the connection myself? I would like to 
avoid storing the username, password, URL, etc. in my code directly.

Thanks again for your help!

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4189937#4189937

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4189937
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to