These are chat archives for inveniosoftware/invenio

24th
Nov 2015
Samuele Kaplun
@kaplun
Nov 24 2015 09:10
Basic question on SQLAlchemy: if I do:
from invenio_ext.sqlalchemy import db
db.session.begin()
This immediately raises an exception:
InvalidRequestError: A transaction is already begun. Use subtransactions=True to allow subtransactions.
Why is this?
If I want to start a new transaction how can I do? (a real one, not a begin_nested one that doesn't really commit at the end...)
Jiri Kuncar
@jirikuncar
Nov 24 2015 09:12
because there is an implicit begin everytime new request is created
db.session.begin(nested=True)
Samuele Kaplun
@kaplun
Nov 24 2015 09:13
Wouldn't this create a nested one (which wouldn't really commit at the end?)
What I am trying to do is the loading 1M records, while committing the work let's say every 1000...
Jiri Kuncar
@jirikuncar
Nov 24 2015 09:15
not possible in 2.2 directly - use celery tasks or migrate to 3.0a
Samuele Kaplun
@kaplun
Nov 24 2015 09:15
So I am trying to wrap the 1000 record loop into something that will really commit. However just calling db.session.commit() at the end of the loop conflicts with any begin_nested.
I see you mean one celery task per group of 1000.
OK
Jiri Kuncar
@jirikuncar
Nov 24 2015 09:16
it has been already done in manage.py or later cli.py in invenio-records by @egabancho
Yoan Blanc
@greut
Nov 24 2015 09:49
quick question, where does the double dollar sign come from in invenio? Wild guess PHP?
Jacopo Notarstefano
@jacquerie
Nov 24 2015 09:49
MathJax?
Yoan Blanc
@greut
Nov 24 2015 09:50
(in Marc21)
Samuele Kaplun
@kaplun
Nov 24 2015 09:53
It's a way to signal the presence of a 'code' in text marc
Yoan Blanc
@greut
Nov 24 2015 09:54
Tomasz Gargas
@tomaszgy
Nov 24 2015 09:58
a simple question I guess - is there a way to cast Record object into json?
Lars Holm Nielsen
@lnielsen
Nov 24 2015 10:13
@tomaszgy record.dumps()
?
Tibor Šimko
@tiborsimko
Nov 24 2015 10:22
@greut Interested in archaeology? :smile: The double dollar sign in MARC comes from Exlibris's ALEPH software's MARC sequential format that CERN Library was using before. E.g. https://github.com/billdueber/marc_alephsequential#description-of-the-aleph-sequential-format Hence various "alephseq" related functions in legacy Invenio like https://github.com/inveniosoftware/invenio/blob/maint-1.2/modules/websearch/lib/search_engine_utils.py#L92
Tomasz Gargas
@tomaszgy
Nov 24 2015 10:25
@lnielsen , thanks a lot, works! :)
Bruno Cuc
@bruno314
Nov 24 2015 10:30
Anyone here with some experience with RequireJS? Would love to ask one question about strange behavior.
Yoan Blanc
@greut
Nov 24 2015 10:42
Yoan Blanc
@greut
Nov 24 2015 10:49
@tiborsimko thanks.
Yoan Blanc
@greut
Nov 24 2015 11:06
so the current marc editor is in fact an editor for aleph marc.
and dojson marc21 is marcxml
greut @greut is confused.
Tibor Šimko
@tiborsimko
Nov 24 2015 11:10
Well, ALEPH MARC is one serialisation, MARCXML another. They should be mutually equivalent. See also tools like textmarc2xmlmarc and xmlmarc2textmarc coming with Invenio legacy. The record editor allows user edits to fields, these edits are propagated to underlying "bibxxx" tables, affecting both textual MARC representation and MARCXML representation, so to speak.