pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Radosław Smogura <rsmogura@softperience.eu>
To: mephysto <mephystoonhell@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Fwd: Postgres JDBC, WS and commit
Date: Tue, 15 May 2012 09:06:35 +0200
Message-ID: <f83a9c836c07ac5ff6f93544c5752488@mail.softperience.eu> (raw)
In-Reply-To: <1337003725711-5708644.post@n5.nabble.com>
References: <CAC92xsrzAeLRHngP2et3j=bmAAw9M257tdzKr1KN9tfpVm=sGw@mail.gmail.com>
	<1336590679429-5698263.post@n5.nabble.com>
	<CADK3HHKE=4xBa2Ghz2qRB2DSjKtBJRJ_RoR5Ud+=ayDTiL_Tow@mail.gmail.com>
	<CAG0sfBXhPOHs+wwQX+8L870tHE-MHzHrV3==HdN9v18vPUA3XQ@mail.gmail.com>
	<9cec544c4e1685dd4ea0c67b9fa5a537@mail.softperience.eu>
	<1336741691434-5702984.post@n5.nabble.com>
	<1986400.Upn4gYaEoZ@radekdesktop>
	<60775583.hWYqdVicEv@radekdesktop>
	<CAG0sfBV6hzBPnm8CoyKpwipZnGp=gM5nKytwtsWZgr1tCZYbxQ@mail.gmail.com>
	<c4f8709c29066021e804daaad0284f0a@mail.softperience.eu>
	<1337003725711-5708644.post@n5.nabble.com>

On Mon, 14 May 2012 06:55:25 -0700 (PDT), mephysto wrote:
> Excuse me but I'm really confused, I did many tests, but I'm not sure 
> about
> results. If I understand it, using glassfish JDBC connection pool, if 
> a
> thread requires a connection to database, glassfish assign one from 
> pool to
> thread and commit is executed at the end of thread, not on every 
> stored
> function launch.
>
> I would, if it is possible, the commit is executed every write stored
> function.
>
> A this point, I would to know if this goal is achievable and if use 
> of
> commit that I wand is admissible. Finally, I would to know, why 
> commit is
> execute by deafult only one time at the end of thread.
>
> Thanks in advance and excuse me newly.
>
> Mephysto
>
> --
> View this message in context:
> 
> http://postgresql.1045698.n5.nabble.com/Postgres-JDBC-WS-and-commit-tp5697657p5708644.html
> Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.

If you are using non transactional connection then commits and 
rollbacks may not be performed by transaction manager (I haven't made 
such tests, but I know connection is not bound to transaction manager), 
when e.g. EJB request ends. Here is short description 
http://docs.oracle.com/cd/E19798-01/821-1752/beamu/index.html - this is 
not standard J2EE behavior. This is why I suggest you to operate with 
REQUIRES_NEW, and slightly rebuilding if required your application. You 
will achieve same result, and your application will be portable, as well 
you have less risky points in application.

For each connection you take from pool you gets new connection.

If you want that commit will be called by stored procedure, call commit 
after procedure call or do something like this

@EJB
EJB self

void doSoemthinf() {
self->callProcedure();
}

@(REQUIRES_NEW)
callPorcedure() {
jdbc chain;
}

In both cases new connection will be taken from pool.

If you have more questions, write prv message. Removing pgsql-jdbc from 
CC.

Regards



view thread (17+ messages)  latest in thread

Message-ID: <f83a9c836c07ac5ff6f93544c5752488@mail.softperience.eu>
Permalink:  ../f83a9c836c07ac5ff6f93544c5752488@mail.softperience.eu/
Also on:    postgresql.org/message-id/f83a9c836c07ac5ff6f93544c5752488@mail.softperience.eu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: rsmogura@softperience.eu, mephystoonhell@gmail.com
  Subject: Re: Fwd: Postgres JDBC, WS and commit
  In-Reply-To: <f83a9c836c07ac5ff6f93544c5752488@mail.softperience.eu>
  References: <CAC92xsrzAeLRHngP2et3j=bmAAw9M257tdzKr1KN9tfpVm=sGw@mail.gmail.com> <1336590679429-5698263.post@n5.nabble.com> <CADK3HHKE=4xBa2Ghz2qRB2DSjKtBJRJ_RoR5Ud+=ayDTiL_Tow@mail.gmail.com> <CAG0sfBXhPOHs+wwQX+8L870tHE-MHzHrV3==HdN9v18vPUA3XQ@mail.gmail.com> <9cec544c4e1685dd4ea0c67b9fa5a537@mail.softperience.eu> <1336741691434-5702984.post@n5.nabble.com> <1986400.Upn4gYaEoZ@radekdesktop> <60775583.hWYqdVicEv@radekdesktop> <CAG0sfBV6hzBPnm8CoyKpwipZnGp=gM5nKytwtsWZgr1tCZYbxQ@mail.gmail.com> <c4f8709c29066021e804daaad0284f0a@mail.softperience.eu> <1337003725711-5708644.post@n5.nabble.com> <f83a9c836c07ac5ff6f93544c5752488@mail.softperience.eu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox