Lock Client-Side TCP-Extends
Hi,
I am running 2 processes on the same server both connecting to one cluster node.
I need to ensure only one process performs a write operation @ a certain time (i.e. the first one to attain the lock).
I am finding that both the processes are getting the lock, and cannot work-out why...
We are using tcp-extends, and I am using the following related cluster configuration:
<caching-scheme-mapping>
<cache-mapping>
<cache-name>cache.cluster.*</cache-name>
<scheme-name>scheme.cluster.system</scheme-name>
</cache-mapping>
</caching-scheme-mapping>
<caching-schemes>
<proxy-scheme>
<scheme-name>scheme.cluster.proxy</scheme-name>
<service-name>service.cluster.proxy</service-name>
<thread-count>4</thread-count>
<acceptor-config>
<tcp-acceptor>
<local-address>
<address system-property="datacloud.node.tcp-extend.bind-address">localhost</address>
<port system-property="datacloud.node.tcp-extend.port">11200</port>
</local-address>
<keep-alive-enabled>true</keep-alive-enabled>
</tcp-acceptor>
</acceptor-config>
<proxy-config>
<cache-service-proxy>
<lock-enabled>true</lock-enabled>
<!--read-only>true</read-only -->
</cache-service-proxy>
</proxy-config>
<autostart>true</autostart>
</proxy-scheme>
<replicated-scheme>
<scheme-name>scheme.cluster.system</scheme-name>
<service-name>ReplicatedCache</service-name>
<lease-granularity>member</lease-granularity>
<member-listener>
<class-name>datacloud.cluster.listeners.ClusterMemberListener</class-name>
</member-listener>
<backing-map-scheme>
<local-scheme />
</backing-map-scheme>
<autostart>true</autostart>
</replicated-scheme>
</caching-schemes>
The client copies this scheme by using the following:
<cache-mapping>
<cache-name>cache.cluster.lock</cache-name>
<scheme-name>scheme.remote</scheme-name>
</cache-mapping>
The lock essentially does:
NamedCache cache = CacheFactory.getCache("cache.cluster.lock")
boolean isLockAcquired = cache.lock("KEY", 5000)
try {
if(isLockAcquired) {
(takes 2 seconds to complete)
} finally {
cache.unlock("KEY")
Why can 2 processes acquire the same lock when asked to acquire it @ the same time?
Edited by: 907011 on 10-Jan-2012 03:33
Hi,
This is my explination of why you are seeing the behaviour you are - I think it is correct but I am sure someone will jump in if not.
1. Your cache config has <lease-granularity>member</lease-granularity> which means that a lock taken out by any thread on a member can be released by the same member. It also means that a Member owns the lock so if I do cache.lock() for a key from some code running on a Member and then do cache.lock() again for the same key on the same Member they will both succeed as the Member owns the lock.
2. Now, when your first process calls <tt>boolean isLockAcquired = cache.lock("KEY", 5000)</tt> it gets the lock but it is not your client process that owns the lock, it is the Extend Proxy your client is connected to that owns it.
3. Consequently when process two, connected to the same Extend proxy, asks for the lock, it gets it too, as it is not your client process that owns the lock, it is the Extend Proxy your client is connected to that owns it.
4. Worse, when process one finishes and releases the lock, then it is released, even though your code in process two still thinks it is running inside the lock.
As I said, that is my understanding of it and why locks do not really work from Extend Clients. In fact there are very few occasions where I would bother to use explicit locks in Coherence (hence my unfamiliarity about the exact workings) as there are usually other, more reliable, ways to achieve the same requirements.
JK
Similar Messages
-
TCP* Extend client thread pool
Hi,
Is there a way to configure the number of threads used by TCP* Extend client? What is the default value for the same?
For some reason I am observing TCP connection being reset. Here are the logs:
2010-05-05 04:39:02.572/15821.6> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Closed: TcpConnection(Id=0x0000012866AD9AC4AAF0E60D08143308BF16B5D3C3356683C13C90CC0213FB3C, Open=false, LocalAddress=170.240.228.192:1105, RemoteAddress=170.240.230.13:27001)
2010-05-05 04:39:02.572/15821.5> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Stopped: TcpInitiator{Name=DistributedCacheForHDElements-NY:TcpInitiator, State=(SERVICE_STOPPED), ThreadCount=0, Codec=Codec(Format=POF), PingInterval=0, PingTimeout=10000, RequestTimeout=10000, ConnectTimeout=10000, RemoteAddresses=[/170.240.230.13:27001,/141.128.62.137:27007,/141.128.62.138:27005,/170.240.230.13:27002,/141.128.62.138:27006,/141.128.62.137:27008,/170.240.230.13:27003,/141.128.62.138:27004], KeepAliveEnabled=true, TcpDelayEnabled=false, ReceiveBufferSize=0, SendBufferSize=0, LingerTimeout=-1}
2010-05-05 04:39:02.588/15821.5> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Started: TcpInitiator{Name=DistributedCacheForHDElements-NY:TcpInitiator, State=(SERVICE_STARTED), ThreadCount=0, Codec=Codec(Format=POF), PingInterval=0, PingTimeout=10000, RequestTimeout=10000, ConnectTimeout=10000, RemoteAddresses=[/141.128.62.138:27006,/141.128.62.138:27005,/170.240.230.13:27003,/141.128.62.138:27004,/170.240.230.13:27002,/141.128.62.137:27007,/141.128.62.137:27008,/170.240.230.13:27001], KeepAliveEnabled=true, TcpDelayEnabled=false, ReceiveBufferSize=0, SendBufferSize=0, LingerTimeout=-1}
2010-05-05 04:39:02.588/15821.5> (thread=[ACTIVE] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Opening Socket connection to 141.128.62.138:27006
2010-05-05 04:39:02.588/15821.nfo> (thread=[ACTIVE] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Connected to 141.128.62.138:27006
2010-05-05 04:39:02.604/15821.6> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Opened: TcpConnection(Id=0x00000128679E39D68D803E8A52F48499974C7DC9B4BF127ECF23CF2771B8CB90, Open=true, LocalAddress=170.240.228.192:4742, RemoteAddress=141.128.62.138:27006)
2010-05-05 04:39:02.604/15821.6> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Opened: Channel(Id=1628408480, Open=true, Connection=0x00000128679E39D68D803E8A52F48499974C7DC9B4BF127ECF23CF2771B8CB90)
2010-05-05 04:39:02.619/15821.6> (thread=DistributedCacheForHDElements-NY:TcpInitiator, member=n/a): Opened: Channel(Id=734361514, Open=true, Connection=0x00000128679E39D68D803E8A52F48499974C7DC9B4BF127ECF23CF2771B8CB90)
Regards,
Kishore
Edited by: user10737736 on May 6, 2010 5:06 AMHi Kishore,
In the proxy-scheme of your cache configuration, you can use thread-count to configure the number of threads used by TCP* Extend client. The default value is 0. e.g.
<proxy-scheme>
<service-name>ExtendTcpProxyService</service-name>
<thread-count>50</thread-count>
</proxy-scheme>
-Luk -
OutOfMemoryError in cluster after TCP-extend client suspends processing.
Anybody able to explain why the following exception might occur... seems to occur when a client connected through tcp-extend is suspended during continuous query processing.
2007-12-20 21:19:49.009 Oracle Coherence GE 3.3.1/389 <Error> (thread=DistributedCache, member=1): Error sending MapEvent to Channel(Id=374515075, Connection=0x00000116F96C67F4A97BDC3A739C40D11DA1C36E3C50F9FBC8BB5AD8DCF4E16E, Open=true): java.lang.OutOfMemoryError: Direct buffer memory
at java.nio.Bits.reserveMemory(Bits.java:633)
at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:95)
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
at com.tangosol.coherence.component.comm.connectionManager.acceptor.TcpAcceptor$ByteBufferPool.instantiateResource(TcpAcceptor.CDB:7)Hi,
We are also getting same excpetion. "java.lang.OutOfMemoryError: Direct buffer memory". I have changed the -XX:MaxDirectMemorySize=256m still getting the same Exception. Tried to investigate by getting the log level to 7 still could not figure out the exact issue. We are running on 3.3.1/389p4 version of Coherence. Only thing I noticed was at times there are many connections in netstat -a o/p in CLOSE_WAIT position.
Please Help!
Regards,
-Amit
This Exception we are getting on TCP Extend Proxy nodes.
2008-06-30 12:54:41.478 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266526720 bytes total
2008-06-30 12:54:41.478 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266536960 bytes total
2008-06-30 12:54:41.478 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266547200 bytes total
2008-06-30 12:54:41.478 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266557440 bytes total
2008-06-30 12:54:41.479 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266567680 bytes total
2008-06-30 12:54:41.479 Oracle Coherence GE 3.3.1/389p4 <D6> (thread=DistributedCache, member=26): Outgoing ByteBufferPool increased to 266577920 bytes total
2008-06-30 12:54:41.789 Oracle Coherence GE 3.3.1/389p4 <Error> (thread=DistributedCache, member=26): Error sending MapEvent to Channel(Id=1140491821, Connection=0x0000011AD950F44BAC1A65A1FB03F9B2AFAE8B5F9FF39688C81572023DF9F53B, Open=true): java.lang.OutOfMemoryError: Direct buffer memory
at java.nio.Bits.reserveMemory(Bits.java:632)
at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:95)
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
at com.tangosol.coherence.component.comm.connectionManager.acceptor.TcpAcceptor$ByteBufferPool.instantiateResource(TcpAcceptor.CDB:7)
at com.tangosol.coherence.component.comm.connectionManager.acceptor.TcpAcceptor$ByteBufferPool.acquire(TcpAcceptor.CDB:26)
at com.tangosol.coherence.component.comm.connectionManager.acceptor.TcpAcceptor$ByteBufferPool.allocate(TcpAcceptor.CDB:4)
at com.tangosol.io.MultiBufferWriteBuffer.advance(MultiBufferWriteBuffer.java:870)
at com.tangosol.io.MultiBufferWriteBuffer.<init>(MultiBufferWriteBuffer.java:32)
at com.tangosol.coherence.component.comm.connectionManager.acceptor.TcpAcceptor$TcpConnection.allocateWriteBuffer(TcpAcceptor.CDB:3)
at com.tangosol.coherence.component.comm.Connection.send(Connection.CDB:16)
at com.tangosol.coherence.component.comm.Channel.doSend(Channel.CDB:4)
at com.tangosol.coherence.component.comm.Channel.send(Channel.CDB:38)
at com.tangosol.coherence.component.net.extend.proxy.MapListenerProxy.onMapEvent(MapListenerProxy.CDB:9)
at com.tangosol.coherence.component.net.extend.proxy.MapListenerProxy.entryInserted(MapListenerProxy.CDB:1)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:191)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$ViewMap$ProxyListener.dispatch(DistributedCache.CDB:22)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$ViewMap$ProxyListener.entryInserted(DistributedCache.CDB:1)
at com.tangosol.util.MapListenerSupport$WrapperSynchronousListener.entryInserted(MapListenerSupport.java:856)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:191)
at com.tangosol.coherence.component.util.CacheEvent.dispatchSafe(CacheEvent.CDB:14)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$BinaryMap.dispatch(DistributedCache.CDB:86)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache.onMapEvent(DistributedCache.CDB:31)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache$MapEvent.onReceived(DistributedCache.CDB:3)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.onMessage(Service.CDB:9)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.onNotify(Service.CDB:130)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.DistributedCache.onNotify(DistributedCache.CDB:3)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:35)
at java.lang.Thread.run(Thread.java:595) -
TCP EXTEND Server SIde configuration
one of the configuration which is required for server proxy scheme is address ofteh server
I can't specify localhost as server and tcp client is going to run on two differenet servers
I have to run this tcp extend server for 3-4 server for failover support
How can I specify address ( IP ADDRESS HERE) which can changed for each server configuration without specifying this config for each server differenetly
can I replace this address besed on property or system parameter or spring injection.
<proxy-scheme>
<service-name>ExtendTcpProxyService</service-name>
<thread-count>5</thread-count>
<acceptor-config>
<tcp-acceptor>
<local-address>
*<address>IP ADDRESS OF SERVER HERE</address>*
<port>9099</port>
</local-address>
</tcp-acceptor>
</acceptor-config>
<autostart>true</autostart>
</proxy-scheme>
</caching-schemes>Why can't you use localhost? Surely this is what you want unless you are running on a machine with multiple network cards and need to bind to a particular address.
If you really want to be able to specify a different address for each machine you can do this
<proxy-scheme>
<service-name>ExtendTcpProxyService</service-name>
<thread-count>5</thread-count>
<acceptor-config>
<tcp-acceptor>
<local-address>
<address system-property="extend.address"></address>
<port>9099</port>
</local-address>
</tcp-acceptor>
</acceptor-config>
<autostart>true</autostart>
</proxy-scheme>Coherence will now use the value of the extend.address system property as the value for your address. This can be passed in on the command line like this:
java -cp coherence.jar -Dextend.address=IP_ADDRESS_HERE com.tangosol.net.DefaultCacheServerObviously your command to start the cache servers would probably have more in it than that.
JK -
ACE30 - PING to VIP and Client side SVI not working
Hi Guys,
Having setup the ACE30 based on the configuration guides, I've been able to get basic load balancing working, probes, stickness etc. However in testing connectivty, I've noticed that from the real server on the backend I cannot seem to PING:
1. The VIP for the web service that the server is a part of
2. The Client side SVI
I'd like this to work to ensure full connectivity.
I've applied ACLs to the Client side SVI (on the ACE) to allow this in both directions, and also removed any ACLs attached to the client side SVI on the MSFC where the subnet is actually homed. However I just cannot seem to PING the Client side SVI on the ACE, or the VIP. Trying to understand if this is normal behavior.
Have inserted my config below for completeness.
ACE30 Config
login timeout 60
hostname ACE1
boot system image:c6ace-t1k9-mz.A90_6_3_5.bin
boot system image:c6ace-t1k9-mz.A4_1_0.bin
resource-class RC_1
limit-resource all minimum 10.00 maximum unlimited
access-list all line 8 extended permit ip any any
access-list v6-any line 8 extended permit ip anyv6 anyv6
class-map type management match-any REMOTE_ACCESS
description Remote access traffic match
2 match protocol telnet any
3 match protocol ssh any
4 match protocol icmp any
5 match protocol https any
policy-map type management first-match REMOTE_MGMT_ALLOW_POLICY
class REMOTE_ACCESS
permit
interface vlan 768
description Management connectivity
ip address 10.20.40.72 255.255.255.0
service-policy input REMOTE_MGMT_ALLOW_POLICY
no shutdown
ip route 0.0.0.0 0.0.0.0 10.20.40.254
context VC_1
allocate-interface vlan 11
allocate-interface vlan 186
member RC_1
username admin password 5 $1$STizNv5q$i96.Qrt4C4SfHkbLyVT74. role Admin domain default-domain
username www password 5 $1$ZAn8bOtv$xmmNlH8akF6iYfXdQCKMo1 role Admin domain default-domain
ssh key rsa1 1024 force
! VC_1
ACE1/VC_1# sh run
probe http HTTP_PROBE1
interval 15
passdetect interval 60
expect status 200 200
open 1
rserver host RS_MONASH_WEB1
description Test Monash Web Server 1
ip address 10.194.27.177
inservice
serverfarm host SF_MONASH_WEB
probe HTTP_PROBE1
rserver RS_MONASH_WEB1 80
inservice
sticky ip-netmask 255.255.255.255 address source STICKY_MONASH_WEB
timeout 3600
serverfarm SF_MONASH_WEB
class-map type management match-any REMOTE_ACCESS
description Remote access traffic match
2 match protocol ssh any
3 match protocol telnet any
4 match protocol icmp any
5 match protocol https any
class-map match-all VS_MONASH_WEB
2 match virtual-address 10.194.11.1 tcp eq www
access-list ALLOW_TRAFFIC_TOWARDS_ACE extended permit ip any any
access-list ALLOW_TRAFFIC_TOWARDS_ACE extended permit icmp any any
policy-map type management first-match REMOTE_MGMT_ALLOW_POLICY
class REMOTE_ACCESS
permit
policy-map type loadbalance first-match PM_MONASH_WEB_LB
class class-default
sticky-serverfarm STICKY_MONASH_WEB
policy-map multi-match PM_MULTI_MATCH_CLIENT_VIP
class VS_MONASH_WEB
loadbalance vip inservice
loadbalance policy PM_MONASH_WEB_LB
service-policy input REMOTE_MGMT_ALLOW_POLICY
interface vlan 11
description Client connectivity on Vlan 11
ip address 10.194.11.250 255.255.255.0
access-group input ALLOW_TRAFFIC_TOWARDS_ACE
access-group out ALLOW_TRAFFIC_TOWARDS_ACE ! not sure if this is required as well?
service-policy input PM_MULTI_MATCH_CLIENT_VIP
no shutdown
interface vlan 186
description CSM www monash
ip address 10.194.27.189 255.255.255.240
access-group input ALLOW_TRAFFIC_TOWARDS_ACE ! not sure if this is required?
access-group out ALLOW_TRAFFIC_TOWARDS_ACE ! not sure if this is required?
ip dhcp relay server 130.194.15.17
ip dhcp relay server 130.194.15.1
ip dhcp relay enable
no shutdown
ip route 0.0.0.0 0.0.0.0 10.194.11.254
6500s
! test-clay1-gw - ACE connects to this 6500
svclc multiple-vlan-interfaces
svclc module 2 vlan-group 2
svclc vlan-group 2 11,171-499,768
! test-clay0-gw - Where Client side subnet, VLAN11 is homed
interface Vlan11
description Testlab server subnet
ip address 10.194.11.253 255.255.255.0
no shut
ip route 10.194.27.176 255.255.255.240 10.194.11.250
thanks
SheldonTo ping your VIP of the webserver, you should apple the service-policy input command on VLAN 186 too. Currently the VIP only listens on VLAN 11. For the SVI i think that was forbidden by security reason, but i cant remember anymore. Maybe you just need to put the management policy on the interface VLAN 186. If it dont work, then my first guess was right
-
Cache config for distributed cache and TCP*Extend
Hi,
I want to use distributed cache with TCP*Extend. We have defined "remote-cache-scheme" as the default cache scheme. I want to use a distributed cache along with a cache-store. The configuration I used for my scheme was
<distributed-scheme>
<scheme-name>MyScheme</scheme-name>
<backing-map-scheme>
<read-write-backing-map-scheme>
<internal-cache-scheme>
<class-scheme>
<class-name>com.tangosol.util.ObservableHashMap</class-name>
</class-scheme>
</internal-cache-scheme>
<cachestore-scheme>
<class-scheme>
<class-name>MyCacheStore</class-name>
</class-scheme>
<remote-cache-scheme>
<scheme-ref>default-scheme</scheme-ref>
</remote-cache-scheme>
</cachestore-scheme>
<rollback-cachestore-failures>true</rollback-cachestore-failures>
</read-write-backing-map-scheme>
</backing-map-scheme>
</distributed-scheme>
<remote-cache-scheme>
<scheme-name>default-scheme</scheme-name>
<initiator-config>
<tcp-initiator>
<remote-addresses>
<socket-address>
<address>XYZ</address>
<port>9909</port>
</socket-address>
</remote-addresses>
</tcp-initiator>
</initiator-config>
</remote-cache-scheme>I know that the configuration defined for "MyScheme" is wrong but I do not know how to configure "MyScheme" correctly to make my distributed cache the part of the same cluster to which all other caches, which uses the default scheme, are joined. Currently, this ain't happening.
Thanks.
RG
Message was edited by:
user602943Hi,
Is it that I need to define my distributed scheme with the CacheStore in the server-coherence-cache-config.xml and then on the client side use remote cache scheme to connect to get my distributed cache?
Thanks, -
TCP Extend (DefaultCacheServer rejects connections)
Hi guys
Have been trying to setup TCP Extend to make a Linux box use cache configured on a windows box and the DefaultCacheServer rejects TCP connections. The config files I'm using are attached. Can anyone help ?
The DefaultCacheServer comes up nicely
SafeCluster: Name=n/a
Group{Address=224.3.2.0, Port=32367, TTL=1}
MasterMemberSet
ThisMember=Member(Id=1, Timestamp=2007-03-29 16:07:16.026, Address=147.114.162.160:54321, MachineId=17312)
OldestMember=Member(Id=1, Timestamp=2007-03-29 16:07:16.026, Address=147.114.162.160:54321, MachineId=17312)
ActualMemberSet=MemberSet(Size=1, BitSetCount=2
Member(Id=1, Timestamp=2007-03-29 16:07:16.026, Address=147.114.162.160:54321, MachineId=17312)
RecycleMillis=120000
RecycleSet=MemberSet(Size=0, BitSetCount=0
Services
TcpRing{TcpSocketAccepter{State=STATE_OPEN, ServerSocket=147.114.162.160:54321}, Connections=[]}
ClusterService{Name=Cluster, State=(SERVICE_STARTED, STATE_JOINED), Id=0, Version=3.2, OldestMemberId=1}
DistributedCache{Name=DistributedCache, State=(SERVICE_STARTED), Id=1, Version=3.2, OldestMemberId=1, LocalStorage=enabled, PartitionCount=257, Bac
upCount=1, AssignedPartitions=257, BackupPartitions=0}
but when I run the client, I get this
2007-03-29 16:09:42.698 Tangosol Coherence DGE 3.2/367 <D4> (thread=TcpRingListener, member=1): Rejecting connection to member 649 using TcpSocket{Sta
te=STATE_OPEN, Socket=Socket[addr=/172.26.102.115,port=36952,localport=54321]}<br><br> <b> Attachment: </b><br>cluster-side-config.xml <br> (*To use this attachment you will need to rename 516.bin to cluster-side-config.xml after the download is complete.)<br><br> <b> Attachment: </b><br>client-side-config.xml <br> (*To use this attachment you will need to rename 517.bin to client-side-config.xml after the download is complete.)Hi pandeyv,
You need to configure an instance of the ProxyService in your cluster-side cache configuration file. Coherence*Extend clients connect to the ProxyService over TCP/IP and not the TcpRingService. The TcpRingService is only used by cluster members for death detection.
See the following for instructions on configuring the cluster and client-side configuration files:
http://wiki.tangosol.com/display/COH32UG/Configuring+and+Using+Coherence*Extend
Additionally, I noticed that you are using an old release of Coherence 3.2. Please upgrade to the latest 3.2 service pack (3.2.2):
http://www.tangosol.com/product-downloads.jsp
Regards,
Jason -
Client side event for h:outputText... and other JSF component
Hello friends...
I need client side (to use Java script ) event for change in <h:outputText /> or <h:inputText...>.
I want to open a popup window when there is a change in there. I donot want to use onblur() for this. Is there any thing for achiev it.
Thanks.
Regard
Roshan Lal ( I don't know why there is "DOG" display in LIST )
:-)Hi Jacek,
Unfortunately I think you may be stuck extending Renderer. Another possibility is creating your component via a template, which will be available in JSF 2.0. However, as JSF 2.0 won't be out for a while... you can use JSFTemplating in the meantime:
http://java.sun.com/developer/technicalArticles/J2EE/jsf_templating/
http://www.theserverside.com/tt/articles/article.tss?l=JSFTemplateComponent
Good luck!
Ken Paulsen
https://jsftemplating.dev.java.net -
"ORA-03113: end-of-file on communication channel error" in client side
Problem Description: we have a production server that oracle 11gr2 installed and oracle clients (application servers) with 11gr2 clients. Sometimes we encounter internal server error 500 at the application server side; and when we check out the application server logs we see ORA-03113 error code.
when we look at the corresponding error on the Oracle Database Server side we saw the following output in the alert_orcl.log :
Fatal NI connect error 12170.
VERSION INFORMATION:
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
Oracle Bequeath NT Protocol Adapter for 64-bit Windows: Version 11.2.0.1.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 64-bit Windows: Version 11.2.0.1.0 - Production
Time: 09-ŞUB-2011 12:46:15
Tracing not turned on.
Tns error struct:
ns main err code: 12535
TNS-12535: TNS: İşlem süresi aşıldı
ns secondary err code: 12609
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=10.1.10.144)(PORT=59999))
Wed Feb 09 12:46:15 2011
what could be the problem or how can i trace it in order to determine the exact problem? is there any parameter that i need to adjust in client side to ensure that every connection reaches the production server ?There is often an ORA-0600 or ORA-7445 behind these.
These should produce an entry in the alert log and an associated trace file which a) can be used in the ORA-600/7445 lookup tool on Metalink and also uploaded to Oracle Support.
Edited by: Dom Brooks on Feb 10, 2011 1:08 PM
A bit quick to answer - I didn't see the large section of TNS information from the alert log. -
Using scan name in tns file not working at client side...
Hi All,
I have installed 2 node RAC -11gR2 on ORACLE VM Server 2.2.1.
now, I want to give tnsentry to dev team to use this RACDB.
I am using scan name in tnsnames.ora file. Also I have make scan name entry in /etc/hosts not in the DNS.
I have below entry in RACDB server...
RACDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = RWCORA-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdb)
== now in dev user side, If I give the same above tns entry and make entry of this scan name and two VIPs in /etc/hosts file of dev user then SQL*Plus is successfully connected but not JDBC like SQL*Developer.
I have make below entry in dev user's /etc/hosts file:
10.40.0.51 RWCORARAC1-vip
10.40.0.52 RWCORARAC2-vip
10.40.0.50 RWCORA-cluster-scan
Is this correct way or suggest me perfect link through which I canconnect all OCI, JDBC connection from client side.
Thanks...you can use JDBC thin URL in SQL developer.
Choose NEW/DATABASE CONNECTION, then put the connection type "Advanced" and then place the jdbc url as :
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=RWCORA-cluster-scan)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=racdb)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=180)(DELAY=5)))) -
ACE in one-arm model. VIP on Client Side, servers in other vlan
Hello All
i have a LAN whit many servers,but only 2 need to be balanced. So i think in one-arm model, due to the higth trafic that not be pass trought ACE.
i have a vlan 900 where is the client side and the VIP also. (10.0.9.64/26)
the servers are in vlan 503 (10.12.3.0/24)
it mi first design with ONE-arm but i thinks something is missing, because doesn't work.
the configuration is the next:
MSFC:
svclc module 1 vlan-group 1,2,
svclc vlan-group 1 503,900-902
svclc vlan-group 2 511
interface Vlan503
description OSS_&_Otros
ip address 10.12.3.253 255.255.255.0
standby 10 ip 10.12.3.254
standby 10 priority 150
standby 10 preempt delay minimum 305
interface Vlan900
description MSF_<->_ACE
ip address 10.0.9.126 255.255.255.192
end
access-list 101 permit ip 10.12.3.0 0.0.0.255 10.0.9.64 0.0.0.63
access-list 101 deny ip any any
route-map From_Server_OSS_to_ACE permit 10
match ip address 101
set ip next-hop 10.0.9.125
ACE_1/admin#
ip route 0.0.0.0 0.0.0.0 10.0.9.126
context OSS
allocate-interface vlan 511
allocate-interface vlan 900
allocate-interface vlan 902
member Max20
ACE_1/OSS# sh run
Generating configuration....
access-list EVERYONE line 10 extended permit ip any any
access-list EVERYONE line 20 extended permit icmp any any
rserver host OSS_FES_1
description OSS_Front_End_Server_1
ip address 10.12.3.140
inservice
rserver host OSS_FES_2
description OSS_Front_End_Server_2
ip address 10.12.3.150
inservice
serverfarm host SERVER_farm_OSS
rserver OSS_FES_1
inservice
rserver OSS_FES_2
inservice
class-map match-all VIP-OSS
2 match virtual-address 10.0.9.66 any
policy-map type loadbalance first-match OSS-LB-POLICY
class class-default
serverfarm SERVER_farm_OSS
policy-map multi-match OSS-POLICY-MAP
class VIP-OSS
loadbalance vip inservice
loadbalance policy OSS-LB-POLICY
loadbalance vip icmp-reply
interface vlan 900
description Clients-side
ip address 10.0.9.125 255.255.255.192
access-group input EVERYONE
access-group output EVERYONE
service-policy input OSS-POLICY-MAP
no shutdown
ip route 0.0.0.0 0.0.0.0 10.0.9.126
maybe a i need to allocate the vlan 503 in OSS Context, any advice?
Thanks in advace,
Gianni From ChileSince you server are not behind the ACE in either bridge or routed mode add the follwoing to your config and use nat to get the traffic back to the ace.
This is how one-armed mode works.
ACE_1/OSS# sh run
Generating configuration....
access-list EVERYONE line 10 extended permit ip any any
access-list EVERYONE line 20 extended permit icmp any any
rserver host OSS_FES_1
description OSS_Front_End_Server_1
ip address 10.12.3.140
inservice
rserver host OSS_FES_2
description OSS_Front_End_Server_2
ip address 10.12.3.150
inservice
serverfarm host SERVER_farm_OSS
rserver OSS_FES_1
inservice
rserver OSS_FES_2
inservice
class-map match-all VIP-OSS
2 match virtual-address 10.0.9.66 any
policy-map type loadbalance first-match OSS-LB-POLICY
class class-default
serverfarm SERVER_farm_OSS
policy-map multi-match OSS-POLICY-MAP
class VIP-OSS
loadbalance vip inservice
loadbalance policy OSS-LB-POLICY
loadbalance vip icmp-reply
nat dynamic 10 vlan 900
interface vlan 900
description Clients-side
ip address 10.0.9.125 255.255.255.192
nat-pool 10 0.9.126 10 0.9.126 netmask 255.255.255.192 pat
access-group input EVERYONE
access-group output EVERYONE
service-policy input OSS-POLICY-MAP
no shutdown -
STRUTS: client-side validation in jsp using DynaValidatorForm
I am supposed to work on struts on as project and it is like learning a crash course and work the next day.
In Struts 1.1 enviroment, I am using DynaValidatorForm to create a bean form and then perform validation.
1. I write a DynaValidatorForm definition in struts-config.xml
2. I write xml for action so that when /getQuotes.do in invoked by a jsp form, the form data is put into the QuoteDetailsBean.
3. add the plugin script for ValidatorPlugIn
xml fragment from struts-config:
//form bean
<form-beans>
<form-bean name="QuoteDetailsBean" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="forename" type="java.lang.String"/>
<form-property name="surname" type="java.lang.String"/>
<form-bean>
</form-beans>
<action
path="/getQuotes"
type="com.kainos.quickquotes.struts.QQGetQuotesAction"
validate="true"
name="QuoteDetailsBean"
input="/userform1.do"
parameter="save"
scope="session">
<forward name="success" path="/pages/jsp/result.jsp"/>
<forward name="back" path="/userform1.do"/>
</action>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>Now I write a validation code for getQuotes.do. note that I can write the validation code with
<form name="QuoteDetailsBean"> but this form bean is shared by many jsp, so i am using the name of the action
(getQuotes) as the name of the form in the validation.xml.
So far this looks okay, as I am going by some example.
xml fragment from validation.xml:
<formset>
<form name="/getQuotes">
<field property="forename" depends="required,minlength">
<arg0 key="QuoteDetailsBean.forename" />
<arg1 name="minlength" key="${var:minlength}" resource="false"/>
<var>
<var-name>minlength</var-name>
<var-value>2</var-value>
</var>
</field>
<field property="surname" depends="required,minlength">
<arg0 key="QuoteDetailsBean.surname" />
<arg1 name="minlength" key="${var:minlength}" resource="false"/>
<var>
<var-name>minlength</var-name>
<var-value>2</var-value>
</var>
</field>
</formset>Now I write the JSP. I use the <html:javascript> tag to allow front-end validation based on the xml in validation.xml.
The jsp code:
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<html:html locale="true">
<head>
<title><bean:message key="welcome.title"/></title>
<html:base/>
<html:javascript formName="/getQuotes"
method="validateForm"
dynamicJavascript="true"
staticJavascript="false"
cdata="false" />
</head>
<body bgcolor="#FFCC9F">
<html:errors />
<html:form action="getQuotes.do" onsubmit="return validateForm(this);" >
Forename:</td> <td>���<html:text property="forename"/></td></tr>
<tr> <td>Surname:</td> <td>���<html:text property="surname"/></td></tr>
<html:submit value="Quotes" /></td></tr>
</html:form>
</body>
</html:html>Does this looks okay. I wrote so far based on some tutorials n help online.
Now when I open the JSP and then do a submit, there is no validation (I tried by submitting with empty forename and surname. I mean i could invoke the action class and the invoke class
redirects(forwards) to the appropriate path. so the code works fine except validation is not done
Q1. So what should i do more to get client-side validation?
What actually happens in client-side validation? does a pop up alert appears?
nothing happens so far in my case.
Q2. What should I do more for server side validation. Since the form is incomplete, what happens?
I thought the same form returns and the error messages are printed in the jsp page since i have the <html:errors />
tag just below the <body> tag.
The action class is pretty simple so far:
public class QQGetQuotesAction extends Action {
public QQGetQuotesAction(){
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
DynaValidatorForm dynaform = (DynaValidatorForm)form;
System.out.println("forename:"+dynaform.get("forename");
System.out.println("surname:"+dynaform.get("surname");
return forward=mapping.findForward("back");
}Please help me out. I think I am missing something which i need to do
thanks
TanveerI think the validations are to be declared on the form
name and not the action path.
Your formName is QuoteDetailsBean but your are using
the action path(/getQuotes) both in the validation
rules and the jsp tags. Use the formName on both the
places.
Also your html:javascript tag will not generate the
static javascript to validate the fields. For this you
will have to add code like below.
<html:javascript dynamicJavascript="false"
staticJavascript="true"/>
Other options is to set the attribute
staticJavascript="true" in your html:javascript tag.
Hope it helps.hi
staticJavascript="true" did the trick. :)
I think the validations are to be declared on the form name and not the action path.It is not necessary. You can declare the validation on the action class. This is essential if a form bean is shared by several JSPs having its own action class. This is as per as I read in a tutorial and it works. -
Client side validation in struts using validation framework
Hi ,
am new to struts.....
I want to validate a simple login page using struts validation framework...
For that i created,
login.jsp ( contains html:errors and html:javascript and onsubmit)
LoginForm extends ValidatorForm
LoginAction
resource bundles
validation.xml ( required, minlength and maxlength rules for both fields)
struts-config.xml ( configured action mapping and form beans)
whats my problem is....
i will get error messages through server side validation...
i cant able to get the error messages using javascript i.e alert messages.
i seen the page resource in that all javascript functins are inserted.
on seeing the javascript error console... it shows
formName has no properties...............
exactly at this line
oRequired = eval('new ' + formName.value + '_required()'); //function validateRequired(form)Thanks for your valuable reply.....
Ya of course what you said was correct....
I got error messages while submitting the form without any value....
error messages are displayed using the <html:errors/> tag (server side validation ).
But it fails to show the alert messages for those errors ( client side validation).
i inserted the <html:javascript formName="form bean name" /> tag in the bottom of my login jsp.....
on seeing the error console, it shows formName has no properties.
Could anybody help me to sort out this problem........ -
Hi Everybody,
Thanks to all of the oracle experts.
We installed oracle 10.2 RAc database on the server side using 2 nodes on solaris 10.
Raw devices are used for clusterware installation.
ASM is configured for database shared files.
Now i want to configure on the client side as they should be able to connect to this database.
would anybody kindly provide me how to do this.
i am in very need of it.
thanks and regards
sureshYou need to install Oracle Software Client and configure tnsnames.ora with something like
ORCLTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oraclerac1vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = oraclerac2vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
You must view oraclerac1vip and oraclerac2vip using DNS or you add this host to host table.
Regards.
Angel -
Could not create client side connection for PDBORCL
Dear all,
we are using oracle database 12c enterprise edition on widows server 2012 standard edition 64bits.
we cannot make a connection from client to the PDBORCL using Net Configuration Assistant.
TNSNAMES.ORA
# tnsnames.ora Network Configuration File: C:\app\Administrator\product\12.1.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.hct.org)
PDBORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = HP426-ORATEST)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PDBORCL.hct.org)
LISTNER.ORA
# listener.ora Network Configuration File: C:\app\Administrator\product\12.1.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\Administrator\product\12.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product\12.1.0\dbhome_1\bin\oraclr12.dll")
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
On my client side, i open NET CONFIGURATION ASSISTAN,
click on LOCAL NET SERVICE NAME CONFIGURATION,
select ADD and click next
on the service name type PDBORCL
select TCP and click next
on the hostname, put the name of the server which is HP426-ORATEST and click next
when i click on YES PERFORM TEST, it give the following error
Connecting...ORA-12170: TNS:Connect timeout occurred
The test did not succeed.
Some of the information you provided may be incorrect.
Click Back to review the information provided for net service name, or Change Login to change username.
we could ping the HP426-ORATEST using cmd on my client.
kindly guide us.
Thank you.LSNRCTL SERVICES
C:\Users\Administrator>LSNRCTL SERVICES
LSNRCTL for 64-bit Windows: Version 12.1.0.1.0 - Production on 23-APR-2014 23:23
:39
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.153.103.202)(PORT=152
1)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "orcl.hct.org" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "orclXDB.hct.org" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: HP426-ORATEST, pid: 3088>
(ADDRESS=(PROTOCOL=tcp)(HOST=HP426-ORATEST.hct.org)(PORT=59070))
Service "pdborcl.hct.org" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
LSNRCTL STATUS
C:\Users\Administrator>LSNRCTL STATUS
LSNRCTL for 64-bit Windows: Version 12.1.0.1.0 - Production on 23-APR-2014 23:24
:38
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.153.103.202)(PORT=152
1)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 12.1.0.1.0 - Produ
ction
Start Date 23-APR-2014 03:44:26
Uptime 0 days 19 hr. 40 min. 16 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app\Administrator\product\12.1.0\dbhome_1\network\a
dmin\listener.ora
Listener Log File C:\app\Administrator\diag\tnslsnr\HP426-ORATEST\listen
er\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=HP426-ORATEST.hct.org)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=HP426-ORATEST.hct.org)(PORT=5500))(
Security=(my_wallet_directory=C:\APP\ADMINISTRATOR\admin\orcl\xdb_wallet))(Prese
ntation=HTTP)(Session=RAW))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl.hct.org" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.hct.org" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "pdborcl.hct.org" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
Maybe you are looking for
-
Hi Gurus, I had blocked one vendor against purchase organisation. In case 1 --- when I tried to create Po with that vendor and pur org, system is throwing error which is fine But in case 2 - I had entered this blocked vendor for fright condition FRB1
-
[SOLVED] Can't get autofs to work with NFS4
NFS share mounts successfully either from fstab or manual mount, but autofs doesn't seem to be able to handle it. My /etc/autofs/auto.master: /nfs /etc/autofs/auto.nfs /etc/autofs/auto.nfs: mountpoint -fstype=nfs4 serv1:/mnt/stor And then: # systemct
-
I have 17inch imac intel 2006 can i use G5 screen number A1058 mine is A1173??
-
The SL upgrade is not doing a whole lot for my faith one way or another. I have a iMac 2.8Ghz and a MBP. I installed SL on the MBP 1st as I had a big issue with sleeping/waking and there were rumours SL would fix the problem (it doesn't). However all
-
Hi I'm into writing library support for the new programming language Timber, (www.timber-lang.org). We have a MAC version out with a rudimentary POSIX interface that works under OS X. I've been experimenting with X11/OpenGL and OpenCL support and hav