I’ve been working on a personal, side-project for about a week. This morning, I finally got transactions working. I need to learn a little more about BDB tuning and I’m not planning on releasing my code until I’m happier with it and it’s been tested more thoroughly.
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Configure
>>> cfg = Configure.Configure()
>>> class Alpha:
... def __init__(self):
... self.field = 'alpha'
...
>>> cfg.databases['objects'][1].get('a')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "RefCache.py", line 110, in get
value = self.repository.get(key)
File "Repository.py", line 104, in get
raise KeyError, key
KeyError: 'a'
>>> txn = cfg.databases['objects'][1].beginTransaction()
>>> a = Alpha()
>>> cfg.databases['objects'][1].put('a', a, txn)
>>> cfg.databases['objects'][1].commitTransaction(txn)
>>> a.field
'alpha'
>>> a = None
>>> a
>>> a = cfg.databases['objects'][1].get('a')
>>> a.field
'alpha'
>>> b = Alpha()
>>> b.field = 'beta'
>>> txn = cfg.databases['objects'][1].beginTransaction()
>>> cfg.databases['objects'][1].put('b', b, txn)
>>> cfg.databases['objects'][1].rollbackTransaction(txn)
>>> cfg.shutdown()
>>> ^D
$ python
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Configure
>>> cfg = Configure.Configure()
>>> class Alpha:
... def __init__(self):
... self.field = 'alpha'
...
>>> b = cfg.databases['objects'][1].get('b')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "RefCache.py", line 110, in get
value = self.repository.get(key)
File "Repository.py", line 104, in get
raise KeyError, key
KeyError: 'b'
>>> a
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'a' is not defined
>>> a = cfg.databases['objects'][1].get('a')
>>> a.field
'alpha'
>>> a = None
>>> a
>>> cfg.shutdown()
>>> ^D
$ db_stat -e -h db
Fri Sep 26 07:35:53 2008 Local time
0x120897 Magic number
0 Panic value
4.7.25 Environment version
...trimmed...
Got transactions working in BDB 4.7 and Python
Posted by Chris Jones
On September 26th, 2008 at 07:44
Permalink | Trackback | Links In |
Comments Off
Posted in Python
On September 26th, 2008 at 07:44
Permalink | Trackback | Links In |
Comments Off
Posted in Python
Categories
Bloglines Blogroll
- A Baggins Under the Hill
- Daily Grind
- The Dolf Zone
- Going On A Safari...
- The Java Rocker
- P7A77's Den o' Love
- samsonfamily.com
- Shaken Angel
- AFK Gamer
- Aggro Me
- Aspen's Blog
- The Corporation @ Corpnews.com - Lying About Games Since Forever
- covert.creations
- The Daedalus Project
- damned vulpine
- Everquest Daily Grind: MMORPG Infinity (no beyond)
- game girl advance
- The Gaming Bitch
- Heartlessgamer.com
- Kill Ten Rats
- MMOG Nation
- My 2 Copper
- Mystic Worlds
- n3rfed
- Plaguelands
- PlayOn
- Sierra Kilo
- Tattered Page
- Terra Nova
- Tide's Horizon
- Tobold's MMORPG Blog
- Van Hemlock
- VirginWorlds Blog
- West Karana
- What Would Matt Do
- Wonderland
- WorldIV.com
- A Dwarf Priest
- Banana Shoulders
- BigRedKitty - Cataclysm
- Blessing of Kings
- The Egotistical Priest
- Enter the Witch!
- Frostbolt, a World of Warcraft Blog
- The Game Dame
- Hogit's Story - A World of Warcraft Blog
- Less QQ, More PewPew
- Mania's Arcania
- Og's Ledger
- Picklemonkey
- Priestly Endeavors - a WoW Blog
- Unbearably HoT
- World of Warcraft Bot - WoW bots exposed
- Broken Toys
- Click Nothing
- Design Synthesis - structure.function.relation
- Devgamer
- Double Buffered
- Evidence-Based Design
- Game Matters
- Game Producer Blog
- GameDevBlog
- Games * Design * Art * Culture
- Games Are Art
- Games from Within
- Grumpy Gamer
- Jeff On Games
- kfsone's pittance
- Lost Garden
- The Ludologist
- Madness & Games
- Mobhunter.com
- Nerfbat
- Online Games Are a Niche Market
- PARANOIA
- Patrick Curry's Thoughts on Game Design
- PlayNoEvil - Game Security, IT Security, and Secure Game Design
- Programmer Joe
- QBlog
- Raph's Website
- Semionaut's Notebook
- SunSword's Edge
- toomuchimagination
- Vicarious Game Designer - PatrickMoran.com
- Working as Designed
- Zen of Design
- Addicting Entertainment
- The Flogging Will Continue...
- The Forge
- GBGames - Thoughts on Indie Game Development
- Make It Big In Games
- PhilSteinmeyer.com
- Psychochild's Blog
- Tales of the Rampant Coyote
