Link to home
Start Free TrialLog in
Avatar of rrahulgupta
rrahulgupta

asked on

Connection Management Structure in C language

I have to design and code the persistence(database) api to insert/update/delete the records in table in C language, there are number of tables in the database and so I want to create a common connection managenet entity so it will be reusable for across the api. To doing this should be my approach?
Avatar of sunnycoder
sunnycoder
Flag of India image

> I want to create a common connection managenet entity so it will be reusable for across the api.
You mean capability to access all table using a single connection? If yes, then connection would remain open until you explicitly close it. Keep passing the handle around and things would work fine. This applies to server side too. you can use multiple threads in master/slave fashion where one thread assigns tasks to other threads to process. Number of tables does not influence your connection.
Avatar of rrahulgupta
rrahulgupta

ASKER

Thanks sunny.
My questioned are inlined:

>You mean capability to access all table using a single connection?
Actually, i was thinking that this will be right approach if i can do it. but i was not sure because i don't have so much experience in C, however, i have pretty good idea about OOPs and java.

> If yes, then connection would remain open until you explicitly close it.
I say, yes. However, i would like to know that there some other option to do the same?  
 
>This applies to server side too. you can use multiple threads in master/slave fashion where one thread assigns tasks to other threads to process. Number of tables does not influence your connection.
I didn't got that. can u plz explain it a bit more, please.

ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial