Yes and no.
Not sure how EJB3 works so I cannot answer yes and no. I can tell you
what you can do.
1) you can define classes
class MyObj:
def say_three(self): return 3
2) you can make instances of the class persistent in various ways by
storing in cache
myobj=cache.ram('myobj',lambda: MyObj(),timeout)
3) you can make instanced persistant for each session
if not session.myobj: session.myobj=MyObj()
4) You can make in memory databases
db=SQBD('sqlite:memory:')
db.define_table('table_in_ram',SQLField('fieldname'))
and you can import/export the data.
import cStringIO
file=cStringIO.String()
db.table_in_ram.export_to_csv_file(file)
file.seek(0)
db.table_in_ram.truncate()
db.table_in_ram.import_form_csv_file(file)
Not sure how this compares with what you have in mind.
I do not expect and I would not want objects that are not stored in
database to expose the same API as if they were.
If you can give me a more explicit example perhaps I can give a
better answer.
Massimo