It turns out that, people in past also had problems when using
PDFWriter under rails, because rails bundles its own version of
Simple Transaction(simple.rb) package.
But the package bundled with rails is not complete and hence the
libraries that need full blown simple transaction package more or less
break.
I have also tried patching activerecord with this patch:
doesn’t seem to work. I am also using LoginEngine code (i.e just the
code, not the engine itself ,for admin interface). But I have got rid
of most of the transaction statements from the code for the time
being.
You look like you’re doing something threaded. I don’t know if that’s
Rails doing it for you, but you can’t dump either threads or mutexes
in Ruby. You must have the latest Transaction::Simple (and Rails really needs to remove it and add the latest version as a
dependency; I’m getting ready to release a new version that’s even
more useful and PDF::Writer will depend on it moving forward).
If the problem is in my code?
If there is a problem with PDFWriter or AR
Or the said patch simply doesn’t work
I suspect 1, 2 (with respect to ActiveRecord bundling
Transaction::Simple; something I’ve asked them to fix a long time
ago), and 3.
I suspect 1, 2 (with respect to ActiveRecord bundling
Transaction::Simple; something I’ve asked them to fix a long time
ago), and 3.
-austin
Hello,
I have exactly the same problem. But the problem doesn’t appear if I
test in local with webrick (in development or production environment)
but it appears with apache+mongrel.
All the libraries are in the same version on both configuration (1.1.6
for rails, 1.3.0 for transaction-simple and 1.1.3 for pdf-writer).
dependency; I’m getting ready to release a new version that’s even
-austin
I really don’t know what to do.
Any help ?
I have tried in vain to patch AR, but it doesn’t seem to ( sorry for
violating DRY)
Hmm…there are couple of things which are threaded in my app, but
they don’t run within rails. For example:
Mongrel itself is threaded.
Backgroundrb I am using, which is threaded.
I am using a third party charting thingy, which is threaded.
But when I went through code of PDFWriter, it seemed that indeed they
create a mutex and start the transaction. Now, there ain’t any mutexes
anywhere in my code and the library I am using is well tucked away. So
only guy creating a mutex was PDFWriter and i suspect PDFWriter is
only trying to dump it.
I am really out of ideas, here… if anyone can help?
But when I went through code of PDFWriter, it seemed that indeed they
create a mutex and start the transaction. Now, there ain’t any mutexes
anywhere in my code and the library I am using is well tucked away. So
only guy creating a mutex was PDFWriter and i suspect PDFWriter is
only trying to dump it.
Trust me. PDF::Writer isn’t trying to dump a mutex here (this is
something I know well). Have you put a PDF variable in a session or
something like that?
something like that?
Good point Austin, and honestly I was populating some PDF variables
from session, But then I removed those lines from code and still the
error.
If you don’t mind can I send you the code offlist and If you can have a look?
Sure. Don’t expect a quick response, though. I’ve written one Rails
application.
Transaction::Simple; something I’ve asked them to fix a long time
ago), and 3.
You could probably distribute a Rails plugin with PDF::Writer as a
workaround. Unless upgrading Transaction::Simple breaks Rails?
I will not be doing so. I provide a Ruby library. I have told the
Rails folks that they should be using Transaction::Simple library as a
gem, because I guarantee compatibility.
-austin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.