Sponsored Content
Special Forums UNIX and Linux Applications Infrastructure Monitoring Database table and Shared mem Sync issues Post 302394561 by trendzy2010 on Friday 12th of February 2010 12:26:52 AM
Old 02-12-2010
Java Database table and Shared mem Sync issues

Hi,

I wanted ideas on how to achieve this efficiently using C++ concept:-

I have a DB table that contains rows of endpoints (say IDs vs names). There is process say "A" that calls another process B's API to increment counters if an operation is performed by an endpoint.
DB table:-
ID Name
1 a1
2 a2
3 a3
Once this increment happens, (say that endpoint[a2] with ID=2 is using process A to execute an increment counter) the endpoint entry is made in B's shared memory.
So at this point here's the state of DB and shared memory maintained by B:-
DB table:-
ID Name
1 a1
2 a2
3 a3
B's shared mem:-
/*format*/
/*ID,endpoint_name,counter_value*/
2,a2,1

Now there is another third-party application that reads and displays the no. of endpoints (using SNMP 'get') that have involved in the increment operation, which it'd get from the B's shared mem directly.
For this it does the follwing:-
1) Get the row count (say x)
2) In a loop it keeps fetching data 'x times'
So the display in third-party application would be (ID is NOT displayed):-
EndPoint Name Counter Value
-------------- -------------
a2__________1
Now if row with ID=2 (a2) in DB table is deleted and created again it is represented in DB as ID=4 (B's shared mem would be unaware of these events). So at this point here's the state of DB table:-
ID Name
1 a1
3 a3
4 a2
B's shared mem:-
/*format*/
/*ID,endpoint_name,counter_value*/
2,a2,1

Now say that endpoint[a2] with ID=4 is using process A to executes an increment counter the endpoint entry is again made in B's shared memory.
Now B's shared mem:-
/*format*/
/*ID,endpoint_name,counter_value*/
2,a2,1
4,a2,1

Also in third-party app:-
EndPoint Name Counter Value
-------------- -------------
a2 __________ 1
a2 __________ 1
This creates multiple entries with same endpoint name!!

[Note:- Fetching is done with ID as index but in display it is not included]
For process B to update its shared mem from DB when an increment is executed will hit performance as DB dip is a costly operation.

Any suggestions buddies?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

export table from oracle database

i would like to export a particular table in my oracle database installed in a hpux box. i would like to determine the filesize of the output before performing these action so i can assess if my harddisk can still handle it. thanks as usuall :rolleyes: (1 Reply)
Discussion started by: inquirer
1 Replies

2. UNIX for Advanced & Expert Users

Upload of the images from the folder to the Database table

Hi all, i am new to the unix enviorment i have got a urgent requirement where we need to migrate the date from the folder heirachy that contains the "IMAGES". These images are to be uploaded on to the database table. Uploading images from the a single folder (Static) to the... (0 Replies)
Discussion started by: shashisaini24
0 Replies

3. Shell Programming and Scripting

ccall database and collect data from one table

I want to connect to one database and collect data from any table using shell script. (0 Replies)
Discussion started by: rinku
0 Replies

4. UNIX for Dummies Questions & Answers

Creating a table (graphic not database)

Hi, I want to create a table on our unix box that allows the user to tab through it and select certain option by putting an asterix or similair into it. e.g. -------------- |Start App | | |Stop App |*| etc... Can this be done using a script (never seen any graphics options in ksh, but... (2 Replies)
Discussion started by: dlam
2 Replies

5. Shell Programming and Scripting

How to use awk for printing line from database table?

Hi , I have inserted some records in a table having column "value1 varchar2(4000)" and want to spool in a file. I have written as below set echo off set feed off set hea off set wra off set lin 500 spo temp_table and fired select query as below select value1 from temp_table; spo... (6 Replies)
Discussion started by: CaapAjayShukla
6 Replies

6. UNIX for Advanced & Expert Users

Synchronize DataBase Table Between Machines Via SSH?

Hello I have 2 servers that need a database table to be one way synchronized (server A needs to push the table to server B) I considered using a FEDERATED DB, but decided against it for my particular application (Server B has several apps that would be calling the table repeatedly, and a... (3 Replies)
Discussion started by: kettlewell
3 Replies

7. UNIX for Advanced & Expert Users

Solaris 10 routing table issues

Hello Hope someone can help with this problem. We are running Solaris 10 with a current kernel patch of 142900-09. We appear to be getting a serious issue with the routing table as shown below: Output from netstat -rnv Destination ....Mask ............Gateway ........Device... (2 Replies)
Discussion started by: gregsih
2 Replies

8. AIX

Cannot get shared lock on database for rpm on AIX 6.1

Hello, I was trying to install python on aix and it was taking too long and I closed the terminal. Now when i issue the command rpm -qa instead of getting all the rpms installed I'm getting the following error. root:stud -> $ rpm -qa cannot get shared lock on database rpmQuery: rpmdbOpen()... (2 Replies)
Discussion started by: gaugeta
2 Replies

9. Shell Programming and Scripting

Update a database table in a for loop

Im trying to update an informix database table for each occurance of a head_barcode in a file called mw within a for loop please see below - cant get the syntax correct. any help please? for a in `cat /tmp/mw` do sql image - << STOP > /dev/null 2>&1 update doc_table set status =... (4 Replies)
Discussion started by: worky
4 Replies
IPC(2)							     Linux Programmer's Manual							    IPC(2)

NAME
ipc - System V IPC system calls SYNOPSIS
int ipc(unsigned int call, int first, int second, int third, void *ptr, long fifth); DESCRIPTION
ipc() is a common kernel entry point for the System V IPC calls for messages, semaphores, and shared memory. call determines which IPC function to invoke; the other arguments are passed through to the appropriate call. User programs should call the appropriate functions by their usual names. Only standard library implementors and kernel hackers need to know about ipc(). CONFORMING TO
ipc() is Linux specific, and should not be used in programs intended to be portable. SEE ALSO
msgctl(2), msgget(2), msgrcv(2), msgsnd(2), semctl(2), semget(2), semop(2), shmat(2), shmctl(2), shmdt(2), shmget(2) Linux 1.2.4 1995-04-15 IPC(2)
All times are GMT -4. The time now is 11:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy