[JCA/JBoss] - Re: JBOSS 3.22 Sybase DB, I Got An Warning Message From Wrapp
by realvalkyrie
"realvalkyrie" wrote : The Detail Info in below:
| [WrappedConnection] WARN Closing a statement you left open, please do your own housekeeping.
| I got connection from the DataSource.
|
| this is my sybase-ds.xml configuration
| <local-tx-datasource>
| <jndi-name>jdbc/eusr</jndi-name>
| <connection-url>jdbc:sybase:Tds:127.0.0.1:2638?ServiceName=eusr</connection-url>
| <driver-class>com.sybase.jdbc2.jdbc.SybDataSource</driver-class>
|
| <user-name>TTT</user-name>
| <p a s s w o r d>TTT</p a s s w o r d>
| <idle-timeout-minutes>5000</idle-timeout-minutes>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
|
| <min-pool-size>5</min-pool-size>
| <max-pool-size>30</max-pool-size>
|
| <type-mapping>Sybase</type-mapping>
|
| </local-tx-datasource>
|
|
|
| <local-tx-datasource>
| <jndi-name>jdbc/esys</jndi-name>
|
| <connection-url>jdbc:sybase:Tds:127.0.0.1:2638?ServiceName=esys</connection-url>
| <driver-class>com.sybase.jdbc2.jdbc.SybDataSource</driver-class>
|
| <user-name>TTT</user-name>
| <p a s s w o r d>TTT</p a s s w o r d>
| <idle-timeout-minutes>5000</idle-timeout-minutes>
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
|
| <min-pool-size>5</min-pool-size>
| <max-pool-size>30</max-pool-size>
|
| <type-mapping>Sybase</type-mapping>
|
| </local-tx-datasource>
|
| Call the Connection code below:
|
| InitialContext initial = new InitialContext();
| DataSource dataSource=null;
| if(name.indexOf("usr")!=-1)
| dataSource =(DataSource) initial.lookup("java:/jdbc/eusr");
| else{
| dataSource =(DataSource) initial.lookup("java:/jdbc/esys");
| }
| Connection con = dataSource.getConnection();
| return con;
|
|
|
|
|
| BTW, I got another WARN
| [TxConnectionManager$LocalXAResource] Prepare called on a local tx. Use of local transactions on a jta transaction with more than one branch may result in inconsistent data in some cases of failure.
|
| Maybe the solution that is to configure a tx DataSource
| I wonder ,did Sybase has tx Datasouce , my sybase version is 12.5.0
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108745#4108745
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108745
18 years, 5 months
[Remoting] - Re: Stupid Bisocket question, how do I do invocations on the
by ron.sigal@jboss.com
Ok, I understand the question. Remoting doesn't currently have a built-in server-to-client invocation facility directly analogous to the client-to-server invocation facility. Of course, you can always explicitly create a Connector on the client side and a Client on the server side.
On the other hand, Remoting has a server-to-client callback facility. Callbacks are like invocations but more general, in the sense that they can be stored on the server until the client retrieves them. One way to set up a callback connection is to create a Connector on the client side and pass an InvokerCallbackHandler and the Connector's InvokerLocator to Client.addListener(). Or, you could simply pass an InvokerCallbackHandler to Client.addListener() and Client will create the Connector for you. In the course of executing Client.addListener(), the server will call ServerInvocationHandler.addListener(). That's not something you should do yourself.
You should look at Section "5.6. Callbacks" of the Remoting Guide (http://labs.jboss.com/jbossremoting/docs/guide/index.html).
As for a bisocket example, well, it's somewhere on my list of things to do (JBREM-773), but, until then, you should look at the example in the org.jboss.remoting.samples.callback package, which uses the socket transport. Setting up a callback connection is largely the same for all transports. There are a few configuration differences between socket and bisocket, but the main one is the use of the org.jboss.remoting.transport.bisocket.Bisocket.IS_CALLBACK_SERVER parameter on the client side if you want the callback server to avoid the use of ServerSockets. (If you don't care about that, then you should be using the socket transport.) For example,
| InvokerCallbackHandler callbackHandler = new SampleCallbackHandler();
| HashMap metadata = new HashMap();
| metadata.put(Bisocket.IS_CALLBACK_SERVER, "true");
| client.addListener(callbackHandler, metadata);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108743#4108743
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108743
18 years, 5 months
[JCA/JBoss] - JBOSS 3.22 Sybase DB, I Got An Warning Message From WrappedCo
by realvalkyrie
The Detail Info in below:
[WrappedConnection] WARN Closing a statement you left open, please do your own housekeeping.
I got connection from the DataSource.
this is my sybase-ds.xml configuration
<local-tx-datasource>
<jndi-name>jdbc/eusr</jndi-name>
<connection-url>jdbc:sybase:Tds:127.0.0.1:2638?ServiceName=eusr</connection-url>
<driver-class>com.sybase.jdbc2.jdbc.SybDataSource</driver-class>
<user-name>TTT</user-name>
TTT
<idle-timeout-minutes>5000</idle-timeout-minutes>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
<min-pool-size>5</min-pool-size>
<max-pool-size>30</max-pool-size>
<type-mapping>Sybase</type-mapping>
</local-tx-datasource>
<local-tx-datasource>
<jndi-name>jdbc/esys</jndi-name>
<connection-url>jdbc:sybase:Tds:127.0.0.1:2638?ServiceName=esys</connection-url>
<driver-class>com.sybase.jdbc2.jdbc.SybDataSource</driver-class>
<user-name>TTT</user-name>
TTT
<idle-timeout-minutes>5000</idle-timeout-minutes>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
<min-pool-size>5</min-pool-size>
<max-pool-size>30</max-pool-size>
<type-mapping>Sybase</type-mapping>
</local-tx-datasource>
Call the Connection code below:
InitialContext initial = new InitialContext();
DataSource dataSource=null;
if(name.indexOf("usr")!=-1)
dataSource =(DataSource) initial.lookup("java:/jdbc/eusr");
else{
dataSource =(DataSource) initial.lookup("java:/jdbc/esys");
}
Connection con = dataSource.getConnection();
return con;
BTW, I got another WARN
[TxConnectionManager$LocalXAResource] Prepare called on a local tx. Use of local transactions on a jta transaction with more than one branch may result in inconsistent data in some cases of failure.
Maybe the solution that is to configure a tx DataSource
I wonder ,did Sybase has tx Datasouce , my sybase version is 12.5.0
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108740#4108740
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108740
18 years, 5 months
[JBoss Seam] - Re: Roles using LDAPLoginModule
by dennisrjohn
I thought that was the case, but it still doesn't seem to work.
I ended up overriding the LDAPLoginModule anyway, here are the relavant pieces:
public class LdapLoginModule extends UsernamePasswordLoginModule {
private static final String BASE_DN = "dc=body,dc=local";
private static final String PRINCIPAL_DN_PREFIX_OPT = "principalDNPrefix";
private static final String PRINCIPAL_DN_SUFFIX_OPT = "principalDNSuffix";
private static final String MATCH_ON_USER_DN_OPT = "matchOnUserDN";
public LdapLoginModule()
{
}
private transient SimpleGroup userRoles = new SimpleGroup("Roles");
...
private void createLdapInitContext(String username, Object credential) throws NamingException
{
...
try
{
NamingEnumeration answer = ctx.search(rolesCtxDN, matchAttrs);
while (answer.hasMore())
{
SearchResult sr = (SearchResult) answer.next();
Attributes attrs = sr.getAttributes();
Attribute roles = attrs.get("name");
for (int r = 0; r < roles.size(); r++)
{
String roleName = roles.get(r).toString();
if (roleName != null)
{
try
{
Principal p = super.createIdentity(roleName);
log.trace("Assign user to role " + roleName);
userRoles.addMember(p);
}
catch (Exception e)
{
log.debug("Failed to create principal: " + roleName, e);
}
}
}
}
}
catch (NamingException e)
{
log.trace("Failed to locate roles", e);
}
...
}
Thanks for the reply, hopefully I'm just missing something.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108739#4108739
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108739
18 years, 5 months
[Installation, Configuration & DEPLOYMENT] - Data Source Hot Deployment Behavior
by diginside
Hi,
In one application we have in production, multiple data sources are specified in one *-ds.xml file. Apparently we have to make changes from time to time. In this particular case, we need to add one data source. In our test run, all the data sources in the file will go through unbinding and binding after the new data source is added. What happens to those active connection pools or connections during this hot deployment? For example, Data source A that's already in the *-ds.xml has one connection pool. Would the connections be destroyed? I assume (or hope) not. What if an incoming request needs one additional connection from this pool? Will it wait until the data source gets refreshed? I'm afraid I may not get this type of details from the log although I have not tried log level lower than debug. So your previous experience or knowledge will be appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108736#4108736
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108736
18 years, 5 months