[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3824: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3826: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3827: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3828: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
Next Framework • Ver Tópico - begin-end transaction (BD) no Next

begin-end transaction (BD) no Next

Não deixe de perguntar, solucione aqui suas dúvidas...

Re: begin-end transaction (BD) no Next

Mensagempor rogelgarcia » Seg Nov 14, 2011 8:49 pm

rogelgarcia
Administrador
 
Mensagens: 674
Data de registro: Qua Jul 08, 2009 9:02 am

Re: begin-end transaction (BD) no Next

Mensagempor rogelgarcia » Seg Nov 14, 2011 8:51 pm

Observação sobre seu código:

1 - Lógica de negócio tem que ficar no Service. Nunca dentro do controller (isso inclui o transactionTemplate).

2 - Nunca passe o request para o service.
rogelgarcia
Administrador
 
Mensagens: 674
Data de registro: Qua Jul 08, 2009 9:02 am

Re: begin-end transaction (BD) no Next

Mensagempor rogelgarcia » Seg Nov 14, 2011 9:01 pm

codigo.png
Código fonte
(28.02 KiB) Não foi feito download ainda
rogelgarcia
Administrador
 
Mensagens: 674
Data de registro: Qua Jul 08, 2009 9:02 am

Re: begin-end transaction (BD) no Next

Mensagempor jtakata » Seg Nov 14, 2011 10:07 pm

Vou olhar com cuidado amanhã.
Quanto aos seus comentários:
1-Lógica de negócio ficar no Service. Entendi conceitualmente mas ainda não sei colocar em prática direito. Pra dizer a verdade, eu não sei direito como usar. A propósito, um service deve sempre estender o GenericService<bean>? O bean deve estar sempre associado a uma entity?
2-Alguma razão especial para nunca passar o request para o service? Embora tenha dito isso, vocë manteve a passagem do request no modelo que me mandou.
Outra coisa, no exemplo2 você colocou a chamada para um único método que grava nas tabelas. No fim, era isso que eu queria fazer, porém, para todas as tabelas envolvidas.Então quer dizer que, se eu estender esse conceito, posso colocar toda a parte da persistência nesse método único. É isso?
jtakata
 
Mensagens: 350
Data de registro: Seg Abr 26, 2010 11:04 pm

Re: begin-end transaction (BD) no Next

Mensagempor rogelgarcia » Ter Nov 15, 2011 4:30 pm

rogelgarcia
Administrador
 
Mensagens: 674
Data de registro: Qua Jul 08, 2009 9:02 am

Re: begin-end transaction (BD) no Next

Mensagempor jtakata » Ter Nov 15, 2011 6:09 pm

1-Está ficando claro esse negócio de Service. Agora precisa sedimentar na minha cabeça ;)
2-Conceitualmente, não passar o request para o Service seria pra isolar/proteger as propriedades do View (do MVC) das demais camadas? Quanto ao método único é isso mesmo que estava pensando. Assim que possível, vou testar.
jtakata
 
Mensagens: 350
Data de registro: Seg Abr 26, 2010 11:04 pm

Re: begin-end transaction (BD) no Next

Mensagempor jtakata » Sex Nov 18, 2011 4:54 pm

jtakata
 
Mensagens: 350
Data de registro: Seg Abr 26, 2010 11:04 pm

Re: begin-end transaction (BD) no Next

Mensagempor jtakata » Qua Nov 23, 2011 9:36 pm

jtakata
 
Mensagens: 350
Data de registro: Seg Abr 26, 2010 11:04 pm

Re: begin-end transaction (BD) no Next

Mensagempor rogelgarcia » Sáb Nov 26, 2011 12:12 am

Você está usando a classe SaveOrUpdateManaged para salvar seus dados?

Experimente chamar o método flush()

O hibernate é meio chato com esse negócio de efetivamente executar os comandos
rogelgarcia
Administrador
 
Mensagens: 674
Data de registro: Qua Jul 08, 2009 9:02 am

Re: begin-end transaction (BD) no Next

Mensagempor jtakata » Sáb Nov 26, 2011 6:47 pm

Uso a classe SaveOrUpdateStrategy para salvar os dados.
Quanto ao método flush(), é pra usar dentro do DAO?
jtakata
 
Mensagens: 350
Data de registro: Seg Abr 26, 2010 11:04 pm

AnteriorPróximo

Retornar para Dúvidas

Quem está online

Usuários vendo este fórum: Nenhum usuário registrado online e 7 visitantes

cron