Well, I've posted this same thing in the Spanish Forum, but I'm in a bit of hurry and no one has answered me yett, so I've decided coming to the original souce of knowledge = English internet posts.
The thing is that I'm working on a project that would control a lock for my door on an IR signal, and this circuit would be continuously connected to my house's electrical supply. But, preventing some electricity cuts whenever there's some storm, I've decided to make a backup battery for being able to open the door and not be locked in or out of my room.
After searching a lot, I've encountered a couple people mentioning that charging Li-ion batteries while using them is possible, so this is my question:
Could I have about three Li-ion batteries serial-connected and charge them while inputing power to my circuit, son if there's a failure with electricity my circuit will be still working with the power remaining on the batteries themselves?
I'm attaching a paint drawing of what I mean, just in case I didn't get to explain myself.
Here are the batteries I could be using:
-Example one
-Example two
Excuse if either my English or my knowledge about electricity are awful... I'm here trying to improve both of them 
Just use a relay. Have your main power energize the relay to close the NO contacts. Then with this you feed in the main power through NO - COM, to your lock.
If the main power is ever cut, then the relay will default to the NC contacts where your LI-ion batteries are connected thus allowing you to still use the lock for a short time.
You want to make a UPS (uninterruptible power supply) and there are probably plans for those on the web.
How about a protected external power point for the lock? Or even a mechanical switch to go from house power to battery? The first would get you past situations where the battery pack would fail.
Just use a relay.
Yes, that's what I've been seeing lately, but the thing is that this thing I'm looking for would save way more space and headaches for me (I think).
Someone on the Spanish forum told me about some kind of charger that whenever current stops, it starts draining from bateries themselves. Do you know anything about this?
GoForSmoke:
You want to make a UPS (uninterruptible power supply) and there are probably plans for those on the web.
How about a protected external power point for the lock? Or even a mechanical switch to go from house power to battery? The first would get you past situations where the battery pack would fail.
Thanks for naming the circuit I'm looking for, that is indeed really useful in my search for answers hahaha
The problem is that I want the circuit to be "minimal", and with this I mean not too complex or big. For example, using a protected external power point as you suggest seems to be a little bit over-the-top for what I need.
On the other hand, what you just said about the mechanical switch just opened my mind... A simple conmutator would be easy enough and I could lead the wires just as I was going to do anyway.
You've probably figured out my solution hahaha
But, anyway, if anyone can get me some help on this topic of the Li-ion batteries, I'd be really happy to learn 
A diode or two can offer a good bit of protection. A zener diode can drain excess voltage up to the current capacity it is rated. Every motor circuit I know of uses a diode to protect against back surge from when the motor field collapses.
I say protection because you never know when someone may try something stupid or bad. No need to make it easy.
Here you can get a lot of help with circuits from long time professionals who know what to watch out for and why. It may save you from replacing batteries more often than you should.
I've been researching Lithium batteries off and on for a while now, and I think you would need a battery management system to take care of a series of cells (e.g. anything more than one). I've not found a good solution for the problem but am looking at the ATmega406. Each cell voltage has a max and a minimum at which the battery needs to be disconnected or it may explode. LiPo also should not be held fully charged for long periods. For example once you charge a cell phone, its best to run it down some (I think removing 20% is fine) before powering it off. All this makes LiPo a pain to work with as a backup supply, especially when compared with lead acid. If you can boost from a single cell that removes some of the pain.